/    Sign up×
Community /Pin to ProfileBookmark

Horizontal Lines

A question so simple I’m almost embarrased to ask…

Is there any way to reduce the margins around a horizontal line?
I’ve tried
<hr style=’margin:0px’> but that didn’t have any effect.

Cheers
CTB

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@chestertbauthorFeb 22.2009 — I should add... I'm not talking about placing in it a <div> with top and left co-ordinates... I'm just wondering if there's a way to effect the <hr> element itself.

CTB
Copy linkTweet thisAlerts:
@C4eaglemFeb 22.2009 — <HR SIZE="1"> 1=pixel size

<HR WIDTH="50%"> 50%=percent of the page

hope that helps ?
Copy linkTweet thisAlerts:
@FangFeb 22.2009 — &lt;!--[if IE]&gt;
&lt;style type="text/css"&gt;
hr {display:block;margin:-.5em 0;}
&lt;/style&gt;
&lt;![endif]--&gt;
Copy linkTweet thisAlerts:
@chestertbauthorFeb 22.2009 — Thanks C4eaglem. It wasn't the actuial size of the line I was asking about, it was the space before and after.

And thanks Fang. That worked adequately in IE, but not so well in FF. Curiously, style='margin-bottom: -.5em 0' didn't work in either.

Cheers

CTB
Copy linkTweet thisAlerts:
@FangFeb 22.2009 — Set [I]margin:0;[/I] for Fx

The condititional comment for IE MUST come after the Fx style which is defined external not inline.
×

Success!

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