Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1343 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Business and Website Management     Advertising, SEO and Social Marketing :

h1, h2, etc tags without linebreak?

Thread title: h1, h2, etc tags without linebreak?
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
04-11-2007, 03:41 AM
#1
Mark Bolyard is offline Mark Bolyard
Mark Bolyard's Avatar
Status: Member
Join date: Sep 2005
Location: Maryland
Expertise:
Software:
 
Posts: 431
iTrader: 3 / 100%
 

Mark Bolyard is on a distinguished road

Send a message via MSN to Mark Bolyard

  Old  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
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

Its a depreciated (wont validate) tag, but it will work with anything out there, try using the <nobr> tag http://www.htmlcodetutorial.com/linepar/_NOBR.html

04-11-2007, 04:18 AM
#3
Mark Bolyard is offline Mark Bolyard
Mark Bolyard's Avatar
Status: Member
Join date: Sep 2005
Location: Maryland
Expertise:
Software:
 
Posts: 431
iTrader: 3 / 100%
 

Mark Bolyard is on a distinguished road

Send a message via MSN to Mark Bolyard

  Old

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
Amross is offline Amross
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
 
Posts: 311
iTrader: 4 / 100%
 

Amross is on a distinguished road

  Old

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
Julian is offline Julian
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
 
Posts: 5,572
iTrader: 0 / 0%
 

Julian is on a distinguished road

  Old

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
Garrett is offline Garrett
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
 
Posts: 2,694
iTrader: 11 / 100%
 

Garrett is on a distinguished road

Send a message via MSN to Garrett

  Old

I myself was going to post what Amross said, I just used that today too!

04-11-2007, 06:34 AM
#7
Julian is offline Julian
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
 
Posts: 5,572
iTrader: 0 / 0%
 

Julian is on a distinguished road

  Old

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
daz is offline daz
Status: I love this place
Join date: Jun 2005
Location: UK
Expertise:
Software:
 
Posts: 562
iTrader: 5 / 100%
 

daz is on a distinguished road

Send a message via MSN to daz

  Old

Originally Posted by Amross View Post
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
Gracia is offline Gracia
Status: I'm new around here
Join date: Apr 2007
Location:
Expertise:
Software:
 
Posts: 17
iTrader: 0 / 0%
 

Gracia is on a distinguished road

  Old

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
Amross is offline Amross
Status: Member
Join date: Jan 2007
Location:
Expertise:
Software:
 
Posts: 311
iTrader: 4 / 100%
 

Amross is on a distinguished road

  Old

Originally Posted by Gracia View Post
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.

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed