/    Sign up×
Community /Pin to ProfileBookmark

when you want extra space between <p>

Since I have my P margins set to 0 to avoid the extra spacing of paragraphs, I am looking for the best approach to put that extra spacing between Paragraphs when it is desired. I am torn between the 2nd and 3rd option.

Any suggestions?


———————–

<p> My text </p>
[B]<p>&nbsp;</p>[/B]
<p> More text </p>


—————————

<p> My text </p>
[B]<br />[/B]
<p> More text </p>


————————-

<p> My text </p>
<p [B]style=”margin-top:20px”> [/B] More text </p>

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@drhowarddrfineFeb 25.2006 — The third option is the one true way. Don't even think about the first one.

If you want to single out only certain <p>s, give them a class

<p class="bigger">somestuff</p>

.bigger {margin-top:20px}

Or, to single out one <p>, give it an id.

<p id="bigger">somestuff</p>

#bigger {margin-top:20px}
Copy linkTweet thisAlerts:
@KravvitzFeb 25.2006 — None of the above.

[url=http://www.w3.org/TR/REC-CSS2/selector.html#class-html]Use a class.[/url]

[url=http://css-discuss.incutio.com/?page=ClassesVsIds]When should I use a class and when should I use an ID?[/url]

Edit: drhowarddrfine beat me to it.
×

Success!

Help @CarlsDad 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.18,
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,
)...