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

Removing Inheritance for list-style-type

I've got a <div class="content"which is within a <div id="main">

I'm finding that the ul and li values for the main div are being
inherited into the content div, in particular, the main div has a
'list-style-type: square' and I cannot get rid of it from the content
div, even though is set to 'list-style-type: none'

Is there a way to force a div class within a div id to not inherit
these values, or some other method to get around this? I'm trying to
use a background image as a custom bullet on my content div but I'm
actually seeing two bullets - the background bullet, and the square
bullet from the parent div.

Thanks for any advice on this.

Dec 12 '07 #1
9 5467
MP12 wrote:
I've got a <div class="content"which is within a <div id="main">

I'm finding that the ul and li values for the main div are being
inherited into the content div, in particular, the main div has a
'list-style-type: square' and I cannot get rid of it from the content
div, even though is set to 'list-style-type: none'

Is there a way to force a div class within a div id to not inherit these
values, or some other method to get around this? I'm trying to use a
background image as a custom bullet on my content div but I'm actually
seeing two bullets - the background bullet, and the square bullet from
the parent div.

Thanks for any advice on this.
Just be more specific with the rule

div.class ul { list-style-type: square; }
div.class div#main ul { list-style-type: none; }

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Dec 12 '07 #2
In article <47**********************@news.zen.co.uk>,
MP12 <mp**@invalid.comwrote:
I've got a <div class="content"which is within a <div id="main">

I'm finding that the ul and li values for the main div are being
inherited into the content div, in particular, the main div has a
'list-style-type: square' and I cannot get rid of it from the content
div, even though is set to 'list-style-type: none'

Is there a way to force a div class within a div id to not inherit
these values, or some other method to get around this? I'm trying to
use a background image as a custom bullet on my content div but I'm
actually seeing two bullets - the background bullet, and the square
bullet from the parent div.

Thanks for any advice on this.
http://netweaver.com.au/alt/divListDivList.html

--
dorayme
Dec 12 '07 #3
MP12 wrote:
I've got a <div class="content"which is within a <div id="main">

I'm finding that the ul and li values for the main div are being
inherited into the content div, in particular, the main div has a
'list-style-type: square' and I cannot get rid of it from the content
div, even though is set to 'list-style-type: none'

Is there a way to force a div class within a div id to not inherit
these values, or some other method to get around this? I'm trying to
use a background image as a custom bullet on my content div but I'm
actually seeing two bullets - the background bullet, and the square
bullet from the parent div.
You can use <dland <dtor <dd>. It looks like <liwith 'list-style-type:
none'
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>

Dec 12 '07 #4
Scripsit Petr Vileta:
You can use <dland <dtor <dd>.
Or <blinkor <clue>.
It looks like <liwith
'list-style-type: none'
In your dreams. But that's irrelevant. The question was about changing
the visual appearance of elements, with the given markup, not about all
kinds of (wrong) markup that might be used.

I haven't seen the original question, but it appears that no URL was
specified so we don't know what the OP really tried*). But the answer to
the question in the Subject line is simple: to break (prevent)
inheritance, assign a value to the property, for the applicable element.

*) It seems that she or he tried to use background images instead of
bullets, somehow resulting in double bullets. Then the question is: why
don't you simply use list-style-image? (Because you don't want bullets
to appear in printed copies? After all, background images are usually
suppressed on printing.)

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Dec 12 '07 #5
Hi, just a quick message to say thanks to the posters who replied.
I've used the advice here and it's now working fine!

Thanks again, much appreciated. I can now let my hair grow back again! :)

Dec 12 '07 #6


Jukka K. Korpela wrote:
*) It seems that she or he tried to use background images instead of
bullets, somehow resulting in double bullets. Then the question is: why
don't you simply use list-style-image? (Because you don't want bullets
to appear in printed copies? After all, background images are usually
suppressed on printing.)
It's too bad CSS doesn't allow for different media types so that someone
could specify background images on the screen and something else on
print media.
Dec 13 '07 #7
William Gill wrote:
>
It's too bad CSS doesn't allow for different media types
Um, it certainly does.
http://www.w3.org/TR/CSS21/media.html

--
Berg
Dec 13 '07 #8


Bergamot wrote:
Um, it certainly does.
http://www.w3.org/TR/CSS21/media.html
Yes, I know. I just didn't want to go into a diatribe about
"cluelessness", unfamiliarity with CSS, confusion, and suggestions that
someone abandon HTML and CSS until they study more.

Sorry, my humor is sometimes elusive. <g>
Dec 13 '07 #9
William Gill wrote:
>
Sorry, my humor is sometimes elusive. <g>
FYI, I think there's a thing called a smiley... ;)

--
Berg
Dec 13 '07 #10

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

Similar topics

4
by: Matthew Bell | last post by:
I've got a conceptual problem to do with inheritance. I'd be grateful if someone could help to clear up my confusion. An example. Say I need a class that's basically a list, with all the...
5
by: Tony Johansson | last post by:
Hello! If you have the following inheritance A is the base class for the derived class B and B is the base class for the derived class C. In this case will the constructor of class C be executed...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
3
by: Jeremy Owens-Boggs | last post by:
We are trying to implement a dual list box selection where you have two list boxes, You highlight items in the right side list box, click a button and this moves those items over to the left hand...
45
by: Ben Blank | last post by:
I'm writing a family of classes which all inherit most of their methods and code (including constructors) from a single base class. When attempting to instance one of the derived classes using...
8
by: ^MisterJingo^ | last post by:
Hi all, I have a question regarding inheritance. I'll use the following code for an example (its been stripped down to the minimum): // code start using System; class Animal {
3
by: Nathan Sokalski | last post by:
I am having trouble removing cookies that I created with my site. Here is the code I am using to try and remove them: If Not Request.Cookies("username") Is Nothing Then...
11
by: John | last post by:
Hi All, Although C# has Generics, it still does not support the generic programming paradigm. Multiple inheritance is required to support real generic programming. Here is a simple design pattern...
1
by: mattmao | last post by:
I am brand new to C#.NET so here is my trial on this lab exercise: using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace lab02exec { ...
11
by: George Sakkis | last post by:
I have a situation where one class can be customized with several orthogonal options. Currently this is implemented with (multiple) inheritance but this leads to combinatorial explosion of...
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
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
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
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,...
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...
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...

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.