CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 18th, 2001, 10:26 PM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
CSS Positioning in Navigator 4.x

I'm trying to position some elements with CSS and it's not really working out in Navigator 4.x

Here is some sample code:

Code:
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="left" valign="top">
<div class="ht2">
Programming
</div>
</td>
</tr>

<tr>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;
</td>

<td align="left" valign="top">
<div class="ht2" style="position: relative; left: +80px;">
JavaScript

<span style="position: relative; left: +40px;">
Testing
</span>
</div>
</td>
</tr>
</table>


In this situation, if the style is defined for one or the other, the DIV or the SPAN, then the positioning for that element works, and everything else is normal. If the style is defined for both the DIV and the SPAN, then the positioning works for the SPAN, and none of the other styles in the document work (there is a lot more content on the page, and a lot of styles).

It works in Explorer 5, and it works in Netscape if the DIV and SPAN are not in the table.

Is this just a routine case of Netscape abjectly malfunctioning without recourse, or is there something I can do to get this to work properly in Netscape 4.x?

By the way, any opinions on CSS positioning replacing tables for layout? I haven't tried much of this with CSS, but I get the feeling it's not realistic to replace table-based layout with CSS positioning at this point in time, if accomodating Netscape. Is this conceivably a realistic strategy in general, assuming all of the established positioning features worked 100%?

Reply With Quote
  #2  
Old August 18th, 2001, 11:28 PM
Jonathon's Avatar
Jonathon Jonathon is offline
T-Shirt Tragic
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 838 Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 10 h 55 m 37 sec
Reputation Power: 215
Send a message via Skype to Jonathon
when you give a div or span a position of absolute or relative you effectively turn it into a layer in NS4.x .. and NS4.x will through a wobbly if it comes across a layer inside a table. Keep all your divs outside the table and it should work ok.

CSS vs tables - all depends on the content I suppose. Web developers/designers do tend to put everything inside a table without thinking about it. I've seen many a page that could have been done in exactly the same layout without the use of a table.

Reply With Quote
  #3  
Old August 19th, 2001, 02:01 AM
rezag rezag is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Toronto
Posts: 12 rezag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 45 sec
Reputation Power: 0
I have a similar(?) question/problem. The following line works as it should (again??) in IE
5.5 but in Netscape 4.x the portion after the style falls to the next line as if a <br> is typed after the </h1> tag.
The style in question only includes only font properties.
<h1>hello </h1> my name is reza.
What am I missing here?
Any help would be appreciated

Reply With Quote
  #4  
Old August 19th, 2001, 08:03 AM
Jonathon's Avatar
Jonathon Jonathon is offline
T-Shirt Tragic
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 838 Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 10 h 55 m 37 sec
Reputation Power: 215
Send a message via Skype to Jonathon
The <h1> tag does imply a linebreak.. if too much space is being rendered beneath the header try using CSS to set the margin ..
margin-bottom:2px;
margin-top:2px;

alternatively you can try using CSS to set the display to inline.. this should remove the linebreak but I think that's probably not what you want.
display:inline;

Reply With Quote
  #5  
Old August 19th, 2001, 08:17 AM
JMM JMM is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: USA
Posts: 830 JMM User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 17 m 56 sec
Reputation Power: 8
Thanks for the heads-up, Jonathon. I frequently author pages that have very complex layouts, like if the home page is a large image that has buttons in it that rollover, I need to slice the image into smaller images and then rebuild the whole image in the browser by putting the images into tables.

The project I'm working on right now is partly to show that I know CSS, so I'm am trying out various things. Up to this point I have been doing the layout with tables, and then I considered doing it with CSS positioning. I am making the page so that it will work sufficiently in IE and NN. I don't know if NN is going to support the positioning features enough for me to completely eliminate my tables for layout, so I don't want to waste hours trying in vain to get it to work.

Reply With Quote
  #6  
Old August 19th, 2001, 09:51 AM
rezag rezag is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Toronto
Posts: 12 rezag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 45 sec
Reputation Power: 0
Quote:
Originally posted by Jonathon
The <h1> tag does imply a linebreak.. if too much space is being rendered beneath the header try using CSS to set the margin ..
margin-bottom:2px;
margin-top:2px;

alternatively you can try using CSS to set the display to inline.. this should remove the linebreak but I think that's probably not what you want.
display:inline;


Thanx but the space beneath is not the problem only the break which I don't want at all.
What if I don't use <h1> instead define a class with the properties I need and use it instead will I be able to get the text continue on the same line after?

Reply With Quote
  #7  
Old August 19th, 2001, 10:02 AM
rezag rezag is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Toronto
Posts: 12 rezag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 45 sec
Reputation Power: 0
Quote:
Originally posted by rezag


Thanx but the space beneath is not the problem only the break which I don't want at all.
What if I don't use <h1> instead define a class with the properties I need and use it instead will I be able to get the text continue on the same line after?



Here is one example:
...
H4{
font-weight : bold;

}

-->
</style>
....
<h4>text </h4>text...

the 'hello' does not stay on the same line in NN. Will I be able to keep it on the same line if I do anything differently? Not use <h4> but define a new class?

Reply With Quote
  #8  
Old August 19th, 2001, 11:10 AM
Jonathon's Avatar
Jonathon Jonathon is offline
T-Shirt Tragic
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 838 Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level)Jonathon User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 10 h 55 m 37 sec
Reputation Power: 215
Send a message via Skype to Jonathon
If you simply want to apply a style to a segment of a sentence or something like that just use the <span> tag.
Code:
blah blah blah <span style="font-weight:bold">bold text</span> blah blah blah.


You could also give your span a class attribute and define the styles for it in the header of the document.

Reply With Quote
  #9  
Old August 20th, 2001, 12:42 AM
evildj evildj is offline
Beelzebub
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: The nether regions...ok, San Diego
Posts: 164 evildj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
You can override a block level element with...
<h1 style="display: inline">

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS Positioning in Navigator 4.x


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway