![]() |
|
#1
|
||||
|
||||
hr/h2 display using CSSIt's been busy for me lately, but I am back for a bit and with a small problem. It seems to be a render issue with Mozilla/IE even though the code validates.
I am trying to achieve the same result, that the code below shows in Mozilla, in IE. In Mozilla, the h2 and hr look basically on the same line, however in IE, there is a nasty gap. HTML: HTML Code:
style.css CSS: CSS Code:
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business. |
||||
|
#2
|
||||
|
||||
|
There is a known CSS problem in IE that is documented around the web, concerning extra vertical spacing issues. I found a solution that I've posted here that works for both IE and Firefox, concerning the your wish to draw a line.
Try getting rid of "hr.titleline" in your CSS, and use the following instead: CSS Code:
In your HTML, do this: HTML Code:
|
|
#3
|
||||
|
||||
|
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business. |
|
#4
|
||||
|
||||
|
How would I modify the h2 tag that I use to have the background for it be only the width of the text (100% in relationship to the text) but allow me to add a 5px padding left/right.
|
|
#5
|
||||
|
||||
|
One way is possibly to surround the text with a span tag that you will then style for the background and paddings?
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#6
|
||||
|
||||
|
I was looking particularly for a way to do it with h2.
If it comes down to it, I will just use a span. __________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business. |
|
#7
|
||||
|
||||
|
What about adding a (h2) style width of 5% (or some other random minimum value) and see what happens? I am hoping the text would simply expand the h2 tag to fit.
I am sorry, I am just guessing at this since I never had to do something like this myself. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#8
|
||||
|
||||
|
I tried that and it made it go onto two lines. It looked like a rectangle with one word on each line.
|
|
#9
|
||||
|
||||
|
Ok, the last resort is to add the display:inline; value in the style attribute of the h2 tag - that will definitely work, but there are things to consider when you do that...
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#10
|
||||
|
||||
|
That seems to work fine. What type of problems do you think I would run into?
I don't see the downside to using it, but I am not that great with CSS yet [edit]In IE, iteems to move the h2 box one pixel above where it should be, thus creating the HR line one pixel below... making it look a bit odd.[/edit] |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Image display problem | Griff | Web Design Forum | 1 | 23-Aug-2004 18:47 |
| Problems with changing display resolution | vsseym | Computer Software Forum - Windows | 2 | 27-Jul-2004 11:01 |
| uisng php to display php | dopee | MySQL / PHP Forum | 6 | 14-May-2004 19:40 |
| algorithm for display complex graph | ctai010 | C++ Forum | 0 | 20-Mar-2004 06:24 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The