473,387 Members | 1,464 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 wont be <LI> background span the whole background?

Im making my first foray into table-less web site design and have run
into a brick wall. This is the URLs:

http://www.ainewmedia.co.uk/css_page.htm
http://www.ainewmedia.co.uk/css_test.css

Im using an inline list for my horizontal navbar items with the right
hand border of each <LIitem set to white 1px to create the illusion
of a divider between each item.

The trouble is, no matter what I try it only fills about 3/4 of the
23px block. I want the divider lines to fill the block from top to
bottom.

Ive tried loads of things but am stuck.

Can anyone please help?

Thanks...John

http://www.ainewmedia.co.uk/css_page.htm

Sep 25 '06 #1
7 1786
On 2006-09-25, jo***********@yahoo.co.uk <jo***********@yahoo.co.ukwrote:
Im making my first foray into table-less web site design and have run
into a brick wall. This is the URLs:

http://www.ainewmedia.co.uk/css_page.htm
http://www.ainewmedia.co.uk/css_test.css

Im using an inline list for my horizontal navbar items with the right
hand border of each <LIitem set to white 1px to create the illusion
of a divider between each item.

The trouble is, no matter what I try it only fills about 3/4 of the
23px block. I want the divider lines to fill the block from top to
bottom.

Ive tried loads of things but am stuck.

Can anyone please help?
This is pretty difficult. You could get it to work by changing the
line-height property of the <ul>, but it's not advisable, as the height
of the <liinline-boxes and therefore of their borders is not precisely
defined.

See CSS 2.1 10.6.1: "The height [...] should be based on the font, but
this specification does not specify how".

The best thing to use here would arguably be inline-block, although
Firefox doesn't support those. So I suggest make the <uland <liboth
float: left, and then you can set the height on the <lito 23px.
Sep 25 '06 #2
Sweet, your last suggested worked perfectly, thanks.

I dont understand why it works and would like to! What was going on
with the floats and why did it make it work? I thought float was used
to make content flow around a block?

Cheers....John

Ben C wrote:
On 2006-09-25, jo***********@yahoo.co.uk <jo***********@yahoo.co.ukwrote:
Im making my first foray into table-less web site design and have run
into a brick wall. This is the URLs:

http://www.ainewmedia.co.uk/css_page.htm
http://www.ainewmedia.co.uk/css_test.css

Im using an inline list for my horizontal navbar items with the right
hand border of each <LIitem set to white 1px to create the illusion
of a divider between each item.

The trouble is, no matter what I try it only fills about 3/4 of the
23px block. I want the divider lines to fill the block from top to
bottom.

Ive tried loads of things but am stuck.

Can anyone please help?

This is pretty difficult. You could get it to work by changing the
line-height property of the <ul>, but it's not advisable, as the height
of the <liinline-boxes and therefore of their borders is not precisely
defined.

See CSS 2.1 10.6.1: "The height [...] should be based on the font, but
this specification does not specify how".

The best thing to use here would arguably be inline-block, although
Firefox doesn't support those. So I suggest make the <uland <liboth
float: left, and then you can set the height on the <lito 23px.
Sep 25 '06 #3
Also, Ive just noticed I am getting the dreaded horizontal scroll bar
appearing! I dont have anything set to over 100% in width - what
goings on?

Thanks.
jo***********@yahoo.co.uk wrote:
Sweet, your last suggested worked perfectly, thanks.

I dont understand why it works and would like to! What was going on
with the floats and why did it make it work? I thought float was used
to make content flow around a block?

Cheers....John

Ben C wrote:
On 2006-09-25, jo***********@yahoo.co.uk <jo***********@yahoo.co.ukwrote:
Im making my first foray into table-less web site design and have run
into a brick wall. This is the URLs:
>
http://www.ainewmedia.co.uk/css_page.htm
http://www.ainewmedia.co.uk/css_test.css
>
Im using an inline list for my horizontal navbar items with the right
hand border of each <LIitem set to white 1px to create the illusion
of a divider between each item.
>
The trouble is, no matter what I try it only fills about 3/4 of the
23px block. I want the divider lines to fill the block from top to
bottom.
>
Ive tried loads of things but am stuck.
>
Can anyone please help?
This is pretty difficult. You could get it to work by changing the
line-height property of the <ul>, but it's not advisable, as the height
of the <liinline-boxes and therefore of their borders is not precisely
defined.

See CSS 2.1 10.6.1: "The height [...] should be based on the font, but
this specification does not specify how".

The best thing to use here would arguably be inline-block, although
Firefox doesn't support those. So I suggest make the <uland <liboth
float: left, and then you can set the height on the <lito 23px.
Sep 25 '06 #4
On 2006-09-25, jo***********@yahoo.co.uk <jo***********@yahoo.co.ukwrote:
Sweet, your last suggested worked perfectly, thanks.

I dont understand why it works and would like to! What was going on
with the floats and why did it make it work? I thought float was used
to make content flow around a block?
It is used for that, but another property of floats is that if you have
a series of left floats they stack up against each other from the left,
until there isn't room, at which point they move down and start from the
left again.

In that respect they behave a little bit like inline-boxes in a
left-to-right formatting context. But the floated boxes themselves are
more like block boxes in the sense that you can precisely control their
height.

So they're not bad for lining up boxes next to each other to do
toolbar type of things.

What you've got is each <litrying to float left inside the <ul>, but
after the first one's floated all the way to left, the second one floats
as far as it can until it bumps into the first one. The third one bumps
into the second one and so on. So they stack up from the left.
Ben C wrote:
>On 2006-09-25, jo***********@yahoo.co.uk <jo***********@yahoo.co.ukwrote:
Im making my first foray into table-less web site design and have run
into a brick wall. This is the URLs:

http://www.ainewmedia.co.uk/css_page.htm
http://www.ainewmedia.co.uk/css_test.css

Im using an inline list for my horizontal navbar items with the right
hand border of each <LIitem set to white 1px to create the illusion
of a divider between each item.

The trouble is, no matter what I try it only fills about 3/4 of the
23px block. I want the divider lines to fill the block from top to
bottom.

Ive tried loads of things but am stuck.

Can anyone please help?

This is pretty difficult. You could get it to work by changing the
line-height property of the <ul>, but it's not advisable, as the height
of the <liinline-boxes and therefore of their borders is not precisely
defined.

See CSS 2.1 10.6.1: "The height [...] should be based on the font, but
this specification does not specify how".

The best thing to use here would arguably be inline-block, although
Firefox doesn't support those. So I suggest make the <uland <liboth
float: left, and then you can set the height on the <lito 23px.
Sep 25 '06 #5
On 2006-09-25, jo***********@yahoo.co.uk wrote:
Im making my first foray into table-less web site design and have run
into a brick wall. This is the URLs:

http://www.ainewmedia.co.uk/css_page.htm
http://www.ainewmedia.co.uk/css_test.css

Im using an inline list for my horizontal navbar items with the right
hand border of each <LIitem set to white 1px to create the illusion
of a divider between each item.

The trouble is, no matter what I try it only fills about 3/4 of the
23px block. I want the divider lines to fill the block from top to
bottom.
Rather than take up only a portion of the block, in my browser
window they overflow the block:
<http://cfaj.freeshell.org/testing/ainewmedia.jpg>
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Sep 25 '06 #6
Chris F.A. Johnson wrote:
On 2006-09-25, jo***********@yahoo.co.uk wrote:
>>
http://www.ainewmedia.co.uk/css_page.htm

no matter what I try it only fills about 3/4 of the 23px block.

in my browser window they overflow the block:
<http://cfaj.freeshell.org/testing/ainewmedia.jpg>
Make your browser window narrower and they will also wrap to a 2nd line,
making it even less attractive.

--
Berg
Sep 25 '06 #7
On 2006-09-25, jo***********@yahoo.co.uk <jo***********@yahoo.co.ukwrote:

snip
http://www.ainewmedia.co.uk/css_page.htm
http://www.ainewmedia.co.uk/css_test.css
snip
Also, Ive just noticed I am getting the dreaded horizontal scroll bar
appearing! I dont have anything set to over 100% in width - what
goings on?
The problem there is:

#right {
position:absolute;
right:1px;
top:174px;
width:15px;
background-color:#999999
}

15px isn't big enough for the content (the word "right"), so that
overflows, and also goes past the 1px you've set for right. So the UA
gives you the scrollbar to take you to the end of the overflowed text.
If you increase right or width a bit the scrollbar goes away.

Better not to set width at all (or set it to "auto"), then the div will
"shrink to fit" the content and be just wide enough.

Other options, depending on what you want, are to set min-width or
max-width on #right. And as a last resort if you set overflow: hidden on
body then whatever happens you shouldn't get the dreaded horizontal
scrollbar.

But for developing your page it may be better not to set overflow:
hidden so you know what's going on.
Sep 25 '06 #8

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

Similar topics

8
by: Michael | last post by:
This is a two-part question to which I haven't been able to find an answer anywhere else. 1. Is it possible to format the bullet/number character of the <li>? In my styles sheet, I have the <li>...
5
by: toylet | last post by:
Attached is some css codes for a website. It has 3 parts: top-bar, side-bar (on the left) and main-body. The top-bar has a mouseover menu called top-menu implemented via ul:hover. When the mouse...
3
by: abro | last post by:
Problem: A list contained in a div contains several items that are made of two parts: itemName and itemValue. ie: <div id="data"> <li>longtime1 <span> 1326 mins></span></li> <li>longtime2...
4
by: Matt | last post by:
Hi, Got an unordered list with 100% width, with 5 list items of 20% width styled to fill the width of the container element. Renders fine in Mozilla, but when you change the size of the window...
2
by: Shaun | last post by:
Hello! I have a quick question regarding CSS and having it applied to all elements. I am trying to eliminate the gap between a paragraph and a list that usually occurs in html and I've found...
2
by: Andrew Donaldson | last post by:
I'd welcome some help in understanding what's going on with graphical browsers in the navigation list at: http://www.bounceandtickle.org.uk/index.html (This site is not about what it might...
2
by: celtique | last post by:
Hello everybody! I've just registered to this forum and yet got a question. :) I've got some database, that is processed by PHP in a 'while' loop and each element that the loop draws (<li>) gets...
5
by: Syl | last post by:
Hello experts!! The top menu navigation bar displays perfectly in IE, but does not display properly in Mozilla or Netscape : http://checkeredshirt.com/textonly.html For some reason the non-IE...
2
by: GloStix | last post by:
For some reason, FF likes to put a black underline on all my buttons. No matter what I do, it has the line I've tried displaying as block and cursor, anything.. Also I've been trying to get it so...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.