Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

A stupid question... I know

Featured Replies

Whenever text is written on a website, whether it is a description of something or whatever, should the text always be wrapped in tags like <a> or <p> for example, or is it ok to just simply write the text in with no tags?

Whenever text is written on a website, whether it is a description of something or whatever, should the text always be wrapped in tags like <a> or <p> for example, or is it ok to just simply write the text in with no tags?

 

Its best if you want to style them :)

  • Author

I meant would you use the <p> tag over the <a> tag, or does it depend on how much you're writing?

I meant would you use the <p> tag over the <a> tag, or does it depend on how much you're writing?

 

<a> and <p> are two different tags used for different purpose

<p> is used for paragraphs and <a> is used for hyperlinks i.e linking pages or objects

learn some html from here w3schools

  • Author

<a> and <p> are two different tags used for different purpose

<p> is used for paragraphs and <a> is used for hyperlinks i.e linking pages or objects

learn some html from here w3schools

 

Thanks for the help, I've read through all that, I just thought maybe people decided to use the <a> tag for all text and just leave out the hyperlink and then do what ever styling they needed to with an id.

I find it a bit worrying you have gone through the w3schools tutorials for HTML yet don't know that an <a> tag is not for throwing large chunks of text into

Personally, I think you should always have your text in a <p> tag, or the very least a <span> tag

  • Author

Thanks for the help guys.

 

As I said, I know the difference... however there is proper practice and then there is what people actually do, I just wanted to know that if someone wants a single line of text with no breaks then would they use an <a> tag or would they use the <p> tag and then use CSS to take away the breaks created with the <p> tag, that was all.

Edited by adamsmith

  • Author

Using a proper CSS reset will remove extraneous styling from p tags any way. This way you can then style them on a per use basis.

Awesome, didn't even think about that, going to do that now. thanks.

  • Author

It's not about practice, preference or anything like that - what you're saying is just plain wrong. If you wanted a block line of text where ALL the text is a hyperlink, then yes, use an a tag. If you wanted a block of text, just text, no links then use a p tag.

 

That's all I wanted to know, thankyou. I feel like I've been given the 3rd degree in this thread lol.

<a href="www.google.com">Click here to visit google</a> that whole sentence there will be a hyperlink to google.

 

<p>Click here to visit <a href="www.google.com">google</a></p> that sentence will be a standard way of writing a paragraph with only google being the hyperlink.

 

got it?

 

:)

Thanks for the help guys.

 

As I said, I know the difference... however there is proper practice and then there is what people actually do, I just wanted to know that if someone wants a single line of text with no breaks then would they use an <a> tag or would they use the <p> tag and then use CSS to take away the breaks created with the <p> tag, that was all.

 

The reason you feel you are getting the 3rd degree is because you keep saying you know the difference and then saying.

 

I just wanted to know that if someone wants a single line of text with no breaks then would they use an <a> tag or would they use the <p>

 

however there is proper practice and then there is what people actually do

 

If you can find anyone that wraps their content in <a> tags I would be very surprised.

 

You can't honestly tell me you have been through w3schools and come out thinking people use them for the same thing?

 

http://www.w3schools.com/html/html_links.asp

 

http://www.w3schools.com/html/html_paragraphs.asp

 

Also don't think this is Server Side Scripting...

 

Sorry if this comes across as harsh Adam but they are completely different and people are just trying to help you.

  • Author

The reason you feel you are getting the 3rd degree is because you keep saying you know the difference and then saying.

 

 

 

 

 

If you can find anyone that wraps their content in <a> tags I would be very surprised.

 

You can't honestly tell me you have been through w3schools and come out thinking people use them for the same thing?

 

http://www.w3schools.com/html/html_links.asp

 

http://www.w3schools.com/html/html_paragraphs.asp

 

Also don't think this is Server Side Scripting...

 

Sorry if this comes across as harsh Adam but they are completely different and people are just trying to help you.

 

I do appreciate all the help, I don't think I made myself clear at the start though. I originally meant that with text in general should tags always be used or is it ok not to use them...

 

ie...

 

...

<body>

Some example text here

</body>

...

 

 

or

 

...

<body>

<p>Some example text here</p>

</body>

...

 

 

Now I know that with CSS reseting <p> should always be used, unless it is a link. The reason I mentioned the <a> tag was because I was thinking of a scenario where somebody wouldn't want the 'breaks' that came with the <p> tags and as a 'work around' might they use the <a> tag instead (without the href link) so that they didn't get the 'breaks' that come with the <p> tag, obviously now with reseting the <p> tags its all become clear, W3Schools didn't mention about CSS reset, I don't think.

Depends on what Doctype you are using. XHTML Strict doesn't allow text to appear unless its in appropriate tags (p, address, etc), transitional doesn't care where it goes as long as its inside a tag. Using a without href attribute is invalid HTMl so you shouldn't use it. The basic rule of thumb here is put stuff where its schematically correct. If its a paragraph of text, put it in p tags. if you want to change some text within a paragraph, use span tags, a list in an appropriate list tag, etc.

 

http://www.cs.tut.fi/~jkorpela/html/empty.html

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.