473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Why doesnt the second row show up?

Al
Hi ppl,

I have copied some code for a 3 column layout with a banner row at the
top.

I am fiddling with the code and went to add a second banner row but it
did not behave as I expected.

Can someone please explain?

Cheers

-Al
[code]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html><head><title>glish.com : CSS layout techniques : 3 columns, the
holy grail</title>

<style type="text/css">
@import "all.css"; /* just some basic formatting, no layout stuff */

body {
margin:10px 10px 0px 10px;
padding:0px;
background:rgb(122,122,122)
}

#leftcontent {
position: absolute;
left:10px;
top:50px;
width:200px;
background:#fff;
border:1px solid #000;
}

#centercontent {
background:#fff;
margin-left: 199px;
margin-right:199px;
border:1px solid #000;
/*
IE5x PC mis-implements the box model. Because of that we sometimes have

to perform a little CSS trickery to get pixel-perfect display across
browsers.
The following bit of code was proposed by Tantek Celik, and it preys
upon a CSS
parsing bug in IE5x PC that will prematurly close a style rule when it
runs
into the string "\"}\"". After that string appears in a rule, then, we
can override
previously set attribute values and only browsers without the parse bug
will
recognize the new values. So any of the name-value pairs above this
comment
that we need to override for browsers with correct box-model
implementations
will be listed below.

We use the voice-family property because it is likely to be used very
infrequently,
and where it is used it will be set on the body tag. So the second
voice-family value
of "inherit" will override our bogus "\"}\"" value and allow the proper
value to
cascade down from the body tag.

The style rule immediately following this rule offers another chance
for CSS2
aware browsers to pick up the values meant for correct box-model
implementations.
It uses a CSS2 selector that will be ignored by IE5x PC.

Read more at http://www.glish.com/css/hacks.asp
*/

voice-family: "\"}\"";
voice-family: inherit;
margin-left: 201px;
margin-right:201px;
}
html>body #centercontent {
margin-left: 201px;
margin-right:201px;
}

#rightcontent {
position: absolute;
right:10px;
top:50px;
width:200px;
background:#fff;
border:1px solid #000;
}

#banner {
background:#fff;
height:40px;
border-top:1px solid #000;
border-right:1px solid #000;
border-left:1px solid #000;
voice-family: "\"}\"";
voice-family: inherit;
height:39px;
}
html>body #banner {
height:39px;
}

p,h1,pre {
margin:0px 10px 10px 10px;
}

h1 {
font-size:14px;
padding-top:10px;
}

#banner h1 {
font-size:14px;
padding:10px 10px 0px 10px;
margin:0px;
}

#rightcontent p {
font-size:10px
}

#box {
border:1px solid #000;
width: 100px;
background:rgb(122,100,200);
}

</style>
</head><body>
<div id="banner"><h1>banner row1</h1></div>
<div id="banner"><h1>banner row2</h1></div>


<div id="leftcontent">
<h1>leftcontent</h1>

</div>

<div id="centercontent">
<h1>centercontent</h1>

</div>

<div id="rightcontent">
<h1>rightcontent</h1>

</div>


</body>
</html>

Jul 21 '05 #1
5 1687
Al wrote:
Hi ppl,

I have copied some code for a 3 column layout with a banner row at the
top.

I am fiddling with the code and went to add a second banner row but it
did not behave as I expected.

Can someone please explain?
A quick glance: id must be unique on a page, and you have two of them
named "banner".
<div id="banner"><h1>banner row1</h1></div>

<div id="banner"><h1>banner row2</h1></div>


Try making one #banner and the other #banner2 or similar.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #2
Al
Could I just make them a class instead?

Well actually I did make them a class but it did not fix the
problem....

-Al

Jul 21 '05 #3
Al wrote:
Could I just make them a class instead?
You could, but a banner area is a major section of real estate on the
page, so I feel that an id is more appropriate.
Well actually I did make them a class but it did not fix the
problem....


Since you only have one style set for these two banner areas, why not
simply put the info for both in the first banner div? Use a bit of
vertical space between...

After another glance at your code (I didn't copy it to a real page),
it looks as if you have a 40px high banner and content that is:

position: absolute;
top:50px;

...so any second banner space is going to be under/behind the content.

Change those "top: 50px" to .. 150px ? See what happens.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #4
Al
Yep - got it sussed now. This CSS takes a bit of getting used to but I
can see its advantages.

-Al

Jul 21 '05 #5
Al wrote:
Yep - got it sussed now. This CSS takes a bit of getting used to
but I can see its advantages.


It's a mindset. <g> So, we gather the positioning was the solution?

Look into setting the sizing of divs, and positioning, by using em
units instead of px, and your design will float and properly expand
when a visitor changes font sizes.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Börni | last post by:
Hi, I have an sql query like this: SELECT column FROM table WHERE column1="3" AND column2="1" This query works perfectly if i run it in the command line, to be exactly it return two results. But...
5
by: Xiphias | last post by:
Hi, Can someone help me to create a drop box where I can also add new records? Here is the problem: I m working on a form with a drop box. When I select a '"name" in the drop box the form...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
3
by: Bruno Paquette | last post by:
I have installed visual studio .net and now i started to write the first few examples from the 70-315 book by Kalani. It looks like all server side code that i put between <% %> doesnt process...
6
by: Dee | last post by:
Hi The paging numbers of my DataGrid dont actually page. What can be the cause? Everyting else seems to work. Thanks Dee
3
by: Brad Rogers | last post by:
All, Being immersed in vb.net and trying CSharp after almost a year I forgot the differences. I like vb fixing the uppercase/lowercase names and seeming to be more flexible to code entry. ...
2
by: Kiran | last post by:
I am creating 2 timers inside a GUI, but it seems that only the one declared last (the second timer), gets triggered, but the first one doesnt. Here is the code for the timers: # main timer,...
3
by: Arun Nair | last post by:
''' Can anyone help me with this program it just takes probability of the first team and runs the program doesnt takes the probability of the second team even though specified''' from random...
0
by: dhvenkat | last post by:
Hi all, Im facing issues in generating the second mail-merge document when the first document created is still open. Its a web based application, and we submit the details for mail-merge after...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.