/    Sign up×
Community /Pin to ProfileBookmark

if u use a header tag, how do you use css or some other way for it to still be a block element, but not put a line break before it…

like spans…

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 08.2005 — You could float it, perhaps:
<i>
</i>...
&lt;style type="text/css"&gt;
&lt;!--
.left {
float: left;
margin: 0 0.5em 0 0;
}
#main {
width: 500px;
margin: 0 auto;
}
--&gt;
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=main&gt;
&lt;h1 class=left&gt;Heading&lt;/h1&gt;
&lt;p&gt;This is a test. It is only a test. Four score and severn years ago our
fathers brought forth upon this continent a new nation, conceived in liberty
and dedicated to the proposition that all men are created equal. Now we are
engaged in a great civil war, testing whether this nation or any other nation
so conceived and so dedicated can long endure.&lt;/p&gt;
&lt;/div&gt;
...
Copy linkTweet thisAlerts:
@ray326May 08.2005 — Maybe you're just talking about its top margin.
Copy linkTweet thisAlerts:
@nodaa90authorMay 08.2005 — yes, i am talking about switching from using a span, to using a h1 tag...the h1 creates a line break before it, but if i make it an inline element, the thing doesnt look right as a header...

so should i float it? (i want the header to be at the top of a containing div)

or do i just edit the h5 margins with css?
Copy linkTweet thisAlerts:
@NogDogMay 09.2005 — If you're just worried about the space above it, then yes, just adjust the top-margin style: [font=courier new]<h5 style="margin-top: 0;">Heading Text</h5>[/font]
×

Success!

Help @nodaa90 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 6.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ,
analytics: Fullres
});

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: @Marika,
tipped: article
amount: 1000 SATS,

tipper: @hatem774,
tipped: article
amount: 1 SATS,

tipper: @nearjob,
tipped: article
amount: 1000 SATS,
)...