By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

how to display h1 inline

P: 1
I want to code a sentence on my website where one word in the middle of the sentence is actually an h1 tag.

Is there any code I can use that will be cross browswer to create this effect?
Dec 27 '11 #1
Share this Question
Share on Google+
4 Replies

Expert 5K+
P: 7,435
An h1 element is a heading and not part of a sentence so you are not allowed to do this.
Dec 28 '11 #2

P: 3
You can write CSS like this:

Dec 29 '11 #3

Expert 5K+
P: 5,058
You may as well just use <span> or <strong> tags and use CSS to make it look like a H1 tag.

Like drhowarddrfine says, the H1-H6 tags are used to specify headers. How does it make sense to put a header into the middle of a sentence?

Unless you are doing this as a SEO trick? If so, I wouldn't bother. It's an old trick that the search engines are well aware of. - The <strong> tags, by the way, are the "natural" way to emphasize words inside a sentence. If the search engines are likely to increase your rankings based on a word within a sentence, those would be the tags to use.
Dec 29 '11 #4

P: 26
display: inline-block;
width: 100px;


float: left;
width: 100px;
Dec 29 '11 #5

Post your reply

Sign in to post your reply or Sign up for a free account.