homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

<strong><a> or <a><strong>
or you don't care?

 3:35 am on Feb 7, 2011 (gmt 0)

When you want to make a link in bold, do you put strong tags around or inside your anchor tags? Does it matter?

I put it inside as I want the phrase to have an accent put on, not the whole HTML code of the link.




 6:29 am on Feb 7, 2011 (gmt 0)

Consistency is always best. Nest your tags to the nearest aspect (text) and all will be well.

<strong><b>word</b></strong> is better than

<strong><b>word</strong></b> though both will display properly. As to <a></a> I have never found that to be a difference...


 1:49 pm on Feb 7, 2011 (gmt 0)

When you want to make a link in bold, do you put strong tags around or inside your anchor tags?

Usually neither. "Bold" is a presentational property, so I'd typically just use CSS to make it bold. If, however, the content of the link is meant to have some emphasis applied to it (for example, such that someone browsing with an screen reader might need to notice a difference between the link and the surrounding text), then I would use the strong tag and put it within the anchor tags. The reason being that you could, in theory, use a background image on the <a> element and then hide the text within the <strong> tag. That is, it's offers more flexibility with regards to styling the link.


 6:10 pm on Feb 7, 2011 (gmt 0)

Visual bolding only, for human viewers = CSS

Need to add semantic meaning to the inline markup - that is, I want to tell devices, not viewers, that this link has emphasis over others - <strong>

There is no rendering difference but as a preference I like to keep all non link content out of the link.

<strong><a href="#">Link Text</a></strong>

Every now and then you'll see some poorly parsed web page that will pick up data from a site and it will convert the carats to entities if they exist between <a> and </a>, so what you get is

<a href="#">&lt;strong&gt;I worked really hard for this inbound link and look at it, it's a mess&lt;/strong&gt;</a>

(When source is viewed; visually, you can see the strong tags)


 12:21 am on Feb 8, 2011 (gmt 0)

I asked solely from SEO perspective. Thanks for pointing to possible problematic rendering.

I found that software like Dreamweaver does it just in order how it's applied which I guess is because the developers thought it was the same thing. That got me curious and I started applying it in the way I described.


 12:08 am on Feb 27, 2011 (gmt 0)

No difference as regards SEO.

I think this has been touched on already, but it makes a difference depending on how you want to style the elements. A similar example...
Call <a href="#"><code>someFunction()</code></a> to get the result.

Without applying a CLASS to the anchor in this case there is no way AFAIK with CSS 2.1 or CSS 3 selectors to specifically style anchors that contain <code>. You can style <code> elements within anchors but, depending on your site, that might not be enough to override the styling on the anchor. So, you might need to have the anchor on the outside of the element for the benefit of CSS.


 2:38 am on Feb 28, 2011 (gmt 0)

<code> has specific, semantic meaning that you can't convey or replace with CSS. Simple bolding of text is another matter altogether.

<b> element for me can occasionally be used as a generic inline container - like span but shorter and with the advantage of having a vestige of visible style differentiation when CSS is disabled. But for SEO, using either b or strong is utterly irrelevant - minor on-page factors such as this count for nothing.

 8:21 am on Mar 2, 2011 (gmt 0)

Try using CSS to make the anchor text link bold ... as it will be the best solution for formatting a webpage ... also it will help to avoid the problem arises due to the hierarchy structure followed in HTML tags ...

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved