|
|
|
|
Thread title: h1, h2, etc tags without linebreak? |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
04-11-2007, 03:41 AM
|
#1
|
Status: Member
Join date: Sep 2005
Location: Maryland
Expertise:
Software:
Posts: 431
|
h1, h2, etc tags without linebreak?
Quick question if anyone knows (well two actually)
1. Can h? tags be used without causing a line break?
2. How can I style my H tags so they look like normal text 10pt arial for example.
Thanks for any help on the above subject.
|
|
04-11-2007, 04:13 AM
|
#2
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
|
|
04-11-2007, 04:18 AM
|
#3
|
Status: Member
Join date: Sep 2005
Location: Maryland
Expertise:
Software:
Posts: 431
|
so this would work?
Code:
<NOBR><h1>all in a day's work.</h1></NOBR>
and there would be no break? Well, if it does, I'm half way there
Thanks!
|
|
04-11-2007, 04:55 AM
|
#4
|
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
Posts: 311
|
1. Yes they can and very simply. Heading tags (h1, h2, etc.) are block level elements and as such, cause the line break. By changing the default display of those elements to inline, you will have the solution to your question:
HTML Code:
h1 {
display: inline;
}
2. The same way you would style any other element using CSS.
|
|
04-11-2007, 05:32 AM
|
#5
|
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
Posts: 5,572
|
To take Amross's reply further and style your <h> tags more completely:
h1 {
display: inline;
font: normal 1em arial, sans-serif;
}
|
|
04-11-2007, 05:47 AM
|
#6
|
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
Posts: 2,694
|
I myself was going to post what Amross said, I just used that today too!
|
|
04-11-2007, 06:34 AM
|
#7
|
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
Posts: 5,572
|
Even better you can use it to do image replacements, have a background image for the h1, and move the text indented -9,000 pixels to the left
|
|
04-11-2007, 10:07 AM
|
#8
|
Status: I love this place
Join date: Jun 2005
Location: UK
Expertise:
Software:
Posts: 562
|
Originally Posted by Amross
1. Yes they can and very simply. Heading tags (h1, h2, etc.) are block level elements and as such, cause the line break. By changing the default display of those elements to inline, you will have the solution to your question:
HTML Code:
h1 {
display: inline;
}
2. The same way you would style any other element using CSS.
|
Neat, didn't know that. Thanks
|
|
04-11-2007, 10:40 AM
|
#9
|
Status: I'm new around here
Join date: Apr 2007
Location:
Expertise:
Software:
Posts: 17
|
Code:
h1,h2,h3,h4,h5 {
margin:0;
padding:0;
}
..and then..
h1 {
padding:3px;
}
and so on. If you do it this way, you don't need the display property and the linebreak.
|
|
04-11-2007, 12:24 PM
|
#10
|
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
Posts: 311
|
Originally Posted by Gracia
Code:
h1,h2,h3,h4,h5 {
margin:0;
padding:0;
}
..and then..
h1 {
padding:3px;
}
and so on. If you do it this way, you don't need the display property and the linebreak.
|
Except for the fact you're doing something different than the intent and it will have a different effect in browsers. Changing the display type to inline is the technically correct method of doing what the thread starter asked. Should they ALSO want to remove any whitespace that certain browsers will display, only then would your method be applicable and recommended.
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
|
|