HTML help needed (CSS knowledge required)

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

HTML help needed (CSS knowledge required)

Post by Diedel » Wed Nov 30, 2005 3:04 am

For my Descent 2 site, I have created a css file containing the following declaration (among others):

H4 {font-family:"Verdana","Arial","Times New I2";font-weight:normal;font-size:14.0pt;color:#FF8000;}

This is a format definition for a header text.

It is used like <H4>Header Text</H4>

I am using this e.g. in my D2 site's news column (which basically is a HTML page displayed in a frame).

With Firefox 1.5, I have started to get an extra linefeed after the </H4> tag. I have tried to put all the text lines in my news page in a table and keep the headers in extra table rows to suppress this behaviour, but it didn't work. I am clueless how to fix this. Any HTML pros around who can help me with this?

Edit:

Found the solution myself.

If I define a css style with an id, I can use it in an ilayer statement that will do the trick:

#H6 {...}

<ilayer id=H6>Header Text</ilayer>
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6415
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw » Wed Nov 30, 2005 10:39 am

sure, don't point us to the page which is broken.

CSS will only work properly if and only if the web page validates properly.

Which basically means you are keeping formating and content seperate.

You are programmer, you can handle compiler errors, you can use validator.w3.org

Here's a handy reference for HTML 4.0. Make good use of it.
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel » Thu Dec 01, 2005 10:16 am

flip,

If I am looking for specific help, I am not looking for arrogant hints how to make something generally better. Apart from that, I have a finite amount of time available. If you don't like my html, avoid my site or fix it for me (in the latter case my eternal gratefulness will be yours). But spare me smart-arsed remarks about my html. And if you don't have enough info and still want to help, you can kindly ask - yes, "kindly", even though your help would be for free.

To put it short: I give a flyin' f*k about your opinion of my html and my skills.

Btw, me thinks you don't know enough about CSS. My fix works - even with an unvalidated page.
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6415
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw » Thu Dec 01, 2005 2:02 pm

Im guessing its this page

Code: Select all

<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <LINK REL=StyleSheet HREF="http://www.descent2.de/std.css">
  <title></title>
  </head>
  <body>
    <h4>test</h1>
    <p>test</p>
  </body>
</html>
the above snippet thats basically using what you where complaing about - that doesn't generate an extra linefeed. so those two in isolation don't generate the condition you were complaining about, wh.

but those br tags inisde your ilayer tags... where they there when you where using the header tags?

And, do ALL your UL tags close? You might want to check this:

Code: Select all

<TR><TD WIDTH=100% CLASS=TCL>
       <P><center><a href=d2x-history.html><font color=#ffe000 size=6><b><u>Current Version: 1.5.28</u></b></font></a></center></P>
       <P>&nbsp;</P>
       <UL>
       <ilayer id=H5>&nbsp;<br><a name=intro>Breaking News</a></ilayer>
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6415
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw » Thu Dec 01, 2005 2:04 pm

Im guessing its this page

Code: Select all

<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.pspad.com">
  <LINK REL=StyleSheet HREF="http://www.descent2.de/std.css">
  <title></title>
  </head>
  <body>
    <h4>test</h1>
    <p>test</p>
  </body>
</html>
the above snippet thats basically using what you where complaing about - that doesn't generate an extra linefeed. so those two in isolation don't generate the condition you were complaining about, wh.

but those br tags inisde your ilayer tags... where they there when you where using the header tags?

And, do ALL your UL tags close? You might want to check this:

Code: Select all

<TR><TD WIDTH=100% CLASS=TCL>
       <P><center><a href=d2x-history.html><font color=#ffe000 size=6><b><u>Current Version: 1.5.28</u></b></font></a></center></P>
       <P>&nbsp;</P>
       <UL>
       <ilayer id=H5>&nbsp;<br><a name=intro>Breaking News</a></ilayer>
User avatar
Diedel
D2X Master
D2X Master
Posts: 5278
Joined: Thu Nov 05, 1998 12:01 pm
Contact:

Post by Diedel » Thu Dec 01, 2005 2:46 pm

flip,

I have solved the problem, and no it's not that page. It was in news.html and there created by a java script printing the news table.

Some <ilayer> </ilayer> compounds may contain <br> tags because I need a linefeed there for a better layout.

And believe it or not: I will sooner or later fix my html code, but that will take time.

I think there is an error in your first code snippet:

<h4>...</h1>

Shouldn't it be </h4>?

<h4>...</h4> will produce an undesired line feed with Firefox 1.5 (didn't do that with 1.07, d'oh). I had it like that before.

The closing </ul> tag is way down near the bottom of the page. The whole stuff between the heading and the image at the page bottom gets indented.

Edit:

I have put a few pages through the validator mentioned at the page you linked, and fixed them. The results were rather disastrous: CSS styles were ignored, The sliding menus didn't slide anymore, there were display problems. No thanks. I prefer quirked html that looks like I want it to. I have the suspicion the whole HTML specs only serve to make ppls' lives harder.

Edit 2:

I have halfway fixed the slide menu, but now I have found out that to have <li>...</li> formatted lines be printed with bullets, you need to put them into <ul> ... </ul>, this enforcing linefeeds before and after the block ... what a crap.

Dang. I have wasted hours and hours on this sh*t.
Post Reply