/    Sign up×
Community /Pin to ProfileBookmark

I know it doesn’t really matter, and is a bit of a trivial question, but should a tag like <b> go in the <p> tags or outside it? Ie., should it be

<p><b>Blah, blah</b></p>

or

<b><p> Blah Blah</p></b>

to post a comment
HTML

7 Comments(s)

Copy linkTweet thisAlerts:
@rhsundergroundJun 18.2005 — well, if you use the tag, it should be like the first, but it would be better like this:

<p style="font-weight:bold">text text text</p>
Copy linkTweet thisAlerts:
@tims15authorJun 18.2005 — Whats the advanmtage with what you suggested it should be like?
Copy linkTweet thisAlerts:
@rhsundergroundJun 18.2005 — tags such as <b>, <i>, <u>, and <center> are being phased out with the expansion of CSS. <u> has already been deprecated by w3. i think it will clear HTML 4.01 validation, but i'm about 99% sure that <b> will raise flags in xHTML validation. also, you can do a lot more with the style="" attribute than simple tags will allow.
Copy linkTweet thisAlerts:
@CharlesJun 18.2005 — CENTER is out and has been since 1998 but B and I are here to stay. But use them with great caution being certain to use CITE, EM and STONG where then meaning would be more clear.

HTML has very strict rules concerning which elements can be contained by which elements. In this case you need to know that P elements are considered block elements that cannot contain other block elements. That's why &lt;p&gt;foo&lt;p&gt;bar&lt;/p&gt; is a valid short hand for &lt;p&gt;foo&lt;/p&gt;&lt;p&gt;bar&lt;/p&gt; But they can contain inline elements. B elements are inline and cannot contain block elements. The rules are spelled out at http://www.w3.org/TR/html401/ . And you can have your work checked by using [url=http://validator.w3.org/]The Validator[/url].
Copy linkTweet thisAlerts:
@tims15authorJun 19.2005 — How can you supposed to center something then?

I always wondered what the point of having strong and emphasized was, as it gave the same ouput as bold and italic
Copy linkTweet thisAlerts:
@NogDogJun 19.2005 — How can you supposed to center something then?[/quote]
It depends on what the "something" is, but you can center text within a block with [b]<p style="text-align: center">[/b]. You can center a fixed-width block with [b]<div style="width: 20em; margin: 0 auto">[/b].
I always wondered what the point of having strong and emphasized was, as it gave the same ouput as bold and italic[/QUOTE]
It's a fairly subtle difference, but "strong" and "emphasis" have an explicit semantic meaning, whereas "bold" and "Italic" are purely for visual presentation and have no inherent meaning.
Copy linkTweet thisAlerts:
@CharlesJun 19.2005 — It's a fairly subtle difference, but "strong" and "emphasis" have an explicit semantic meaning, whereas "bold" and "Italic" are purely for visual presentation and have no inherent meaning.[/QUOTE]HTML, when done properly, should work on all browsers and platforms and not all browsers and platforms can display bold or italic. Seeing users have become used to bold indicating a heading or strong emphasis and we can tell the diference by the way the page is laid out. Someone using a screen reader or a search engine might not be able to figure it out. If you are using bold to make a heading then you should use one of the H elements; if you are using bold for strong emphasis then you should use STRONG. Likewise, if you are using I for a citation or a title then you should use CITE but if you are using ot for emphasis then you should use EM.
×

Success!

Help @tims15 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...