473,396 Members | 2,010 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,396 software developers and data experts.

List problem

Hello,

I have the following code:

<div id="outer" class="outer">
<ol>
<li>Item outer 01</li>
<li>Item outer 02</li>
</ol>
<div id="inner" class="inner">
<ol>
<li>Item inner 01</li>
<li>Item inner 02</li>
</ol>
</div>
</div>

I have some CSS as follows:

..outer ol {...}
..outer ol il {...}

..inner ol {...}
..inner ol il {...}

The ol inside outer div is completely fine.
However, when I set some properties for the inner ol and il they don't
seem to take effect.

It's like the outer style overrides the inner style.

Could someone tell me what I am doing wrong?

Thanks,
Miguel

Jun 13 '07 #1
13 2324
shapper wrote:
I have the following code:

<div id="outer" class="outer">
<ol>
<li>Item outer 01</li>
<li>Item outer 02</li>
</ol>
<div id="inner" class="inner">
<ol>
<li>Item inner 01</li>
<li>Item inner 02</li>
</ol>
</div>
</div>

I have some CSS as follows:

.outer ol {...}
applies to all ol's which are descendents of elements with class outer.
The ol inside your "inner" div is included.
.outer ol il {...}
applies to all list items which are descendents of ol's which are
themselves descendents of elements with class outer. All the li's you've
shown us are included.
>
.inner ol {...}
applies to all ol's which are descendents of elements with class inner.
.inner ol il {...}
applies to all list items which are descendents of ol's which are
themselves descendents of elements with class inner.
>
The ol inside outer div is completely fine.
However, when I set some properties for the inner ol and il they don't
seem to take effect.

It's like the outer style overrides the inner style.

Could someone tell me what I am doing wrong?
Is this the actual order of your CSS rules? Have you read about
specificity in the specs? What properties are you trying to set? As
usual, a URL would help.

--
John
Jun 13 '07 #2
On Jun 13, 4:40 pm, John Hosking <J...@DELETE.Hosking.name.INVALID>
wrote:
shapper wrote:
I have the following code:
<div id="outer" class="outer">
<ol>
<li>Item outer 01</li>
<li>Item outer 02</li>
</ol>
<div id="inner" class="inner">
<ol>
<li>Item inner 01</li>
<li>Item inner 02</li>
</ol>
</div>
</div>
I have some CSS as follows:
.outer ol {...}

applies to all ol's which are descendents of elements with class outer.
The ol inside your "inner" div is included.
.outer ol il {...}

applies to all list items which are descendents of ol's which are
themselves descendents of elements with class outer. All the li's you've
shown us are included.
.inner ol {...}

applies to all ol's which are descendents of elements with class inner.
.inner ol il {...}

applies to all list items which are descendents of ol's which are
themselves descendents of elements with class inner.
The ol inside outer div is completely fine.
However, when I set some properties for the inner ol and il they don't
seem to take effect.
It's like the outer style overrides the inner style.
Could someone tell me what I am doing wrong?

Is this the actual order of your CSS rules? Have you read about
specificity in the specs? What properties are you trying to set? As
usual, a URL would help.

--
John
Hi,

I don't have a url. My outer CSS is as follows:

..outer ol
{
border-top: 1px solid #F0F0F0;
font: normal 11px/18px verdana,arial,helvetica,sans-serif;
list-style: none;
margin: 4px 4px 0px 4px;
padding: 0px 0px 4px 0px;
}

..outer ol li
{
padding: 5px 0px 5px 140px;
}

..outer ol li label
{
background: transparent;
color: #606060;
float: left;
font: bold 11px/18px verdana,arial,helvetica,sans-serif;
padding-right: 15px;
text-align: right;
margin: -1px 0px 0px -140px;
width: 120px;
}

I want to maintain only the font and the list-style in inner ol and
ils.
I am having problems in removing the paddings and margins from the
inner ol and il.

How should I do it?

Thanks,
Miguel

Jun 13 '07 #3
shapper wrote:
>
I don't have a url.
Please upload your code to a publicly accessible server and post the
URL. If your domain is not public, your ISP may give you some free
space, or go someplace like yahoo/geocities if you're desperate.

Make it easy for us to help you and you'll get a much better response.
Posting code is not the way, posting a URL is.

--
Berg
Jun 13 '07 #4
On Jun 13, 5:35 pm, Bergamot <berga...@visi.comwrote:
shapper wrote:
I don't have a url.

Please upload your code to a publicly accessible server and post the
URL. If your domain is not public, your ISP may give you some free
space, or go someplace like yahoo/geocities if you're desperate.

Make it easy for us to help you and you'll get a much better response.
Posting code is not the way, posting a URL is.

--
Berg
I understand but this code in ASP.NET and it is not so easy to upload
an unfinished site ... and all HTML is generated on the server.

Anyway, I changed the CSS to:

ol.inner
{
border-top: 1px solid #F0F0F0;
font: normal 11px/18px verdana,arial,helvetica,sans-serif;
list-style: none;
margin: 4px 4px 0px 4px;
padding: 0px 0px 4px 0px;

}

li.inner
{
padding: 5px 0px 5px 140px;

}

Then I apply the inner class to my li and ol tags and now it is
working fine.
I don't understant why this does not work when I use:

..inner il {...}
..inner ol {...}

In this case the properties do not override the outer styles.

Thanks,
Miguel

Jun 13 '07 #5
shapper wrote:
On Jun 13, 5:35 pm, Bergamot <berga...@visi.comwrote:
>shapper wrote:
I don't have a url.

Posting code is not the way, posting a URL is.

I understand but this code in ASP.NET
That's irrelevant.
and it is not so easy to upload
Sure it is. You can see the generated page locally, can't you? Save that
as an HTML page and upload it, complete with images, CSS, and whatever
other files are needed.

I suggest using Firefox rather than IE to save such pages, though,
because IE tends to horribly mangle code in the process. Firefox (or any
other mozilla browser) will leave the code relatively untouched.

--
Berg
Jun 13 '07 #6
On Jun 13, 11:30 pm, Bergamot <berga...@visi.comwrote:
shapper wrote:
On Jun 13, 5:35 pm, Bergamot <berga...@visi.comwrote:
shapper wrote:
I don't have a url.
Posting code is not the way, posting a URL is.
I understand but this code in ASP.NET

That's irrelevant.
and it is not so easy to upload

Sure it is. You can see the generated page locally, can't you? Save that
as an HTML page and upload it, complete with images, CSS, and whatever
other files are needed.

I suggest using Firefox rather than IE to save such pages, though,
because IE tends to horribly mangle code in the process. Firefox (or any
other mozilla browser) will leave the code relatively untouched.

--
Berg
Hi Berg,

This is not so easy as you might think because of the ASP.NET web site
model but I was able to pull this:
http://www.27lamps.com/public/Beta.htm

As you can see the for is it self a Div (fieldset) with an ordered
list inside.
Then in some list items I add child ordered lists.

In this moment I am having two problems:
1. Override the parent definitions for a ol and il.
This has been maybe one of my biggest problems. I was able to
solve it for Alert ordered list but I think by CSS solution is far
from perfect.
You can also see the same problem in the section when it says
SKYPE and where I have an ordered list of check boxes.
2. In the SKYPE section again you can see that I also have 3 top lines
in grey ... I think this is because of the block.

Anyway, could someone help me out in improving my CSS and solving
these problems?

Thank You Very Much,
Miguel
Jun 13 '07 #7
shapper wrote:
This is not so easy as you might think because of the ASP.NET web site
model but I was able to pull this:
http://www.27lamps.com/public/Beta.htm
Miguel, thanks for providing a URL. Unfortunately, the code is much too
complicated for me to wade through. All that JS, encryted and not, is
more than I can take. I just ate. :-O~~#
>
Anyway, could someone help me out in improving my CSS and solving
these problems?
All I can tell you right now is that your CSS does not validate. (What's
that third [BonsAlunos...] "stylesheet" referenced in your source's
LINKs?) Maybe if you clean up the errors in your CSS, the problems might
clear right up.

HTH
--
John
Jun 13 '07 #8
shapper wrote:
>
This is not so easy as you might think because of the ASP.NET web site
model but I was able to pull this:
http://www.27lamps.com/public/Beta.htm

As you can see
I have to agree with Mr Hosking on this one - your code (HTML and CSS)
is very hard to decipher. You should make a reduced test case, and
validate your code. Maybe then the solution will even reveal itself to you.

--
Berg
Jun 14 '07 #9
On Jun 14, 2:26 am, Bergamot <berga...@visi.comwrote:
shapper wrote:
This is not so easy as you might think because of the ASP.NET web site
model but I was able to pull this:
http://www.27lamps.com/public/Beta.htm
As you can see

I have to agree with Mr Hosking on this one - your code (HTML and CSS)
is very hard to decipher. You should make a reduced test case, and
validate your code. Maybe then the solution will even reveal itself to you.

--
Berg
Hi Berg,

As I said, the code generated by ASP.NET becomes confusing.

I will create an clean HTML page today replicating the code in ASP.NET
and post it again ... just give me some time.

Thanks,
Miguel

Jun 14 '07 #10
On Jun 14, 12:19 pm, shapper <mdmo...@gmail.comwrote:
On Jun 14, 2:26 am, Bergamot <berga...@visi.comwrote:
shapper wrote:
This is not so easy as you might think because of the ASP.NET web site
model but I was able to pull this:
>http://www.27lamps.com/public/Beta.htm
As you can see
I have to agree with Mr Hosking on this one - your code (HTML and CSS)
is very hard to decipher. You should make a reduced test case, and
validate your code. Maybe then the solution will even reveal itself to you.
--
Berg

Hi Berg,

As I said, the code generated by ASP.NET becomes confusing.

I will create an clean HTML page today replicating the code in ASP.NET
and post it again ... just give me some time.

Thanks,
Miguel
Hi,

I just uploaded a new version. I "cleaned" all the code.
http://www.27lamps.com/public/Beta.htm

Could you give me your advice?
Check the borders over skype and also my problem with the child li's.

I validated my code and I got only two parse problems which I can't
understand why.

Thanks,
Miguel

Jun 14 '07 #11
shapper wrote:
>
I just uploaded a new version. I "cleaned" all the code.
http://www.27lamps.com/public/Beta.htm

Check the borders over skype and also my problem with the child li's.
I don't know what you mean about the child li's, but the border issue is
from not clearing your floats. This subject has come up many, many times
in this newsgroup. You should find lots of info about it in the google
archives. See also
http://brainjar.com/css/positioning/
http://www.quirksmode.org/css/clearing.html

--
Berg
Jun 14 '07 #12
On Jun 14, 4:50 pm, Bergamot <berga...@visi.comwrote:
shapper wrote:
I just uploaded a new version. I "cleaned" all the code.
http://www.27lamps.com/public/Beta.htm
Check the borders over skype and also my problem with the child li's.

I don't know what you mean about the child li's, but the border issue is
from not clearing your floats. This subject has come up many, many times
in this newsgroup. You should find lots of info about it in the google
archives. See alsohttp://brainjar.com/css/positioning/http://www.quirksmode.org/css/clearing.html

--
Berg
Hi Berg,

I know about clearing floats ... however the overflow approach is new
to me.

Anyway, I uploaded a new version of my problem.
Check the DIV where I apply the style "ListBox" class.

My two problems are:
1. The ListBox is not being applied to the child tags, i.e., ol and
li.
They have the styles defined by parent classes.

2. The only way I was able to solve this was by applying ListBox to
the OL and all LI inside that DIV.
How can I solve this?

3. When I use the approach in (2) my second problem becomes the
clearing floats in my ol.
I applied the overflow approach to my OL tag but I wasn't able to
solve it.

Well, these are the problems I am trying to solve.

Thanks,
Miguel

Jun 14 '07 #13
On Jun 14, 7:59 pm, shapper <mdmo...@gmail.comwrote:
On Jun 14, 4:50 pm, Bergamot <berga...@visi.comwrote:
shapper wrote:
I just uploaded a new version. I "cleaned" all the code.
>http://www.27lamps.com/public/Beta.htm
Check the borders over skype and also my problem with the child li's.
I don't know what you mean about the child li's, but the border issue is
from not clearing your floats. This subject has come up many, many times
in this newsgroup. You should find lots of info about it in the google
archives. See alsohttp://brainjar.com/css/positioning/http://www.quirksmode.org/css/cle...
--
Berg

Hi Berg,

I know about clearing floats ... however the overflow approach is new
to me.

Anyway, I uploaded a new version of my problem.
Check the DIV where I apply the style "ListBox" class.

My two problems are:
1. The ListBox is not being applied to the child tags, i.e., ol and
li.
They have the styles defined by parent classes.

2. The only way I was able to solve this was by applying ListBox to
the OL and all LI inside that DIV.
How can I solve this?

3. When I use the approach in (2) my second problem becomes the
clearing floats in my ol.
I applied the overflow approach to my OL tag but I wasn't able to
solve it.

Well, these are the problems I am trying to solve.

Thanks,
Miguel
Hi,

I just fixed it:
http://www.27lamps.com/public/Beta.htm

Now it is working fine!

Overall, what do you think of my form CSS?
Do you have any suggestions so I can improve it?

Thanks,
Miguel

Jun 15 '07 #14

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

Similar topics

12
by: Kin®sole | last post by:
Hi I'm very new to VB (using VB6) I have two lists one blank and one containing names in the format of surname and then forename.I also have a combo box containing forenames.When I select a...
35
by: Moosebumps | last post by:
Does anyone here find the list comprehension syntax awkward? I like it because it is an expression rather than a series of statements, but it is a little harder to maintain it seems. e.g. you...
1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
7
by: Shawn Windle | last post by:
----begin node.h-------- #ifndef NODE_H #define NODE_H #include <iostream> //NULL using namespace std; class node {
4
by: Piotr Sawuk | last post by:
First off, thanks for the help, this group was a great support for my efforts of learning c++. However, yet again I plan to throw away what I programmed and re-use a little more of what stl has to...
5
by: John N. | last post by:
Hi All, Here I have a linked list each containing a char and is double linked. Then I have a pointer to an item in that list which is the current insertion point. In this funtion, the user...
7
by: Kieran Simkin | last post by:
Hi all, I'm having some trouble with a linked list function and was wondering if anyone could shed any light on it. Basically I have a singly-linked list which stores pid numbers of a process's...
57
by: Xarky | last post by:
Hi, I am writing a linked list in the following way. struct list { struct list *next; char *mybuff; };
1
by: David Bilsby | last post by:
All Apologies for cross posing this but I am not sure if this is a VC 8 STL bug or simply an invalid use of the iterator. I have a PCI card access class which basically abstracts a third party...
7
by: =?Utf-8?B?Sm9lbCBNZXJr?= | last post by:
I have created a custom class with both value type members and reference type members. I then have another custom class which inherits from a generic list of my first class. This custom listneeds...
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: 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: 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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.