473,388 Members | 1,375 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,388 software developers and data experts.

remove formatting for certain objects

Gang,

I am trying to create/update webpages using CSS and modern
programming (getting away from using tables to place text and
objects). I am running into an issue using ul's. I will give you the
code below:

<ul class="liCol1">
<li>Vendor name</li>
<li>Address</li>
<li>City St, Zip</li>
<li>Phone number</li>
<li class="liSpacer">&nbsp;</li>
<li>Data directory</li>
<li>Temp directory</li>
<li class="liSpacer">&nbsp;</li>
<li>DSA keys</li>
</ul>

and here is the css from an external file:

..ulCol1 {
list-style: none;
text-decoration: none;
margin: 0px;
padding: 0px;
}

..liCol1 li {
margin: 4 0 0 0;
height: 17px;
}

..liSpacer {
margin: 0px;
padding: 0px;
height: 12px;
font-size: 10px;
}

This works just fine for the li's that have text in them. The ones
that have the class="liSpacer" don't seem to use css that is given.
Why would this not take effect? Is there a way that I can stop
inheritence from the ".liCol1 li" section? Any help would greatly be
appreciated.

Also note, that there may be several of these on a page so I was
trying to avoid giving each ul an id.

Feb 1 '07 #1
10 6578
In article
<11*********************@p10g2000cwp.googlegroups. com>,
he******@yahoo.com wrote:
Gang,

I am trying to create/update webpages using CSS and modern
programming (getting away from using tables to place text and
objects). I am running into an issue using ul's. I will give you the
code below:

<ul
that have the class="liSpacer" don't seem to use css that is given.
Why would this not take effect? Is there a way that I can stop
inheritence from the ".liCol1 li" section? Any help would greatly be
appreciated.

Also note, that there may be several of these on a page so I was
trying to avoid giving each ul an id.
You could look at simply classing some of the <li>s - either at
the top or bottom of the junctures wanted - and assign bigger
bottom or top margins. There is an example of this sort of thing
at:

<http://sn2.com.au>

--
dorayme
Feb 1 '07 #2
On 2007-02-01, he******@yahoo.com <he******@yahoo.comwrote:
Gang,

I am trying to create/update webpages using CSS and modern
programming (getting away from using tables to place text and
objects). I am running into an issue using ul's. I will give you the
code below:
[snip]
.liCol1 li {
margin: 4 0 0 0;
height: 17px;
}

.liSpacer {
margin: 0px;
padding: 0px;
height: 12px;
font-size: 10px;
}

This works just fine for the li's that have text in them. The ones
that have the class="liSpacer" don't seem to use css that is given.
It looks like .liCol1 li is more "specific" than .liSpacer. See CSS 2.1
6.4.3.
Why would this not take effect?
If you make ".liSpacer" ".liCol1 li.liSpacer" instead, it will become
more specific (two classes and one element beats one class and one
element).
Is there a way that I can stop inheritence from the ".liCol1 li"
section? Any help would greatly be appreciated.
Not that I know of. You can give all the non-spacer <li>s their own
class and then you can select them with a selector that won't match the
spacers as well. Otherwise override everthing you set in .liCol1 li in
..liCol1 li.liSpacer to set it back to the default.
Feb 1 '07 #3
Scripsit he******@yahoo.com:
I am trying to create/update webpages using CSS and modern
programming (getting away from using tables to place text and
objects).
Whether you use modern programming is immaterial. CSS is not programming,
though you can write programs that generate, read, modify, or interpret CSS
code.

There is nothing wrong with using tables when you have tabular data. Whether
an address is tabular data is debatable, but the fact is that there are
authors who are "getting aways from using tables" in vain, even making their
pages less logical and more difficult to maintain.
I am running into an issue using ul's.
When you have run into an issue with CSS, it's virtually always a waste of
everyone's time to post a question without revealing the URL.
I will give you the code below:
You are not giving yourself good chances of getting the help you need.
<ul class="liCol1">
<li>Vendor name</li>
<li>Address</li>
<li>City St, Zip</li>
<li>Phone number</li>
<li class="liSpacer">&nbsp;</li>
<li>Data directory</li>
<li>Temp directory</li>
<li class="liSpacer">&nbsp;</li>
<li>DSA keys</li>
</ul>
What's "liCol1"? Class names should be descriptive of meaning and structure,
not cryptic codes for intended formatting.

Why the spacer items? Use vertical margins instead.
and here is the css from an external file:

.ulCol1 {
list-style: none;
text-decoration: none;
margin: 0px;
padding: 0px;
}
Why do you present this snippet? There is no class "ulCOl1" in your markup
snippet.
.liCol1 li {
margin: 4 0 0 0;
height: 17px;
}
4 of what? Did you forget to use the "CSS Validator" to check whether your
style sheet is even formally correct? Why 17px? The px unit should normally
be used in user style sheets only. Why do you set the height in the first
place?
.liSpacer {
margin: 0px;
padding: 0px;
height: 12px;
font-size: 10px;
}
Instead, assign a class to an item after which some spacing is desired, and
simply set e.g. margin-bottom: 1em for it.
This works just fine
No it doesn't.
for the li's that have text in them. The ones
that have the class="liSpacer" don't seem to use css that is given.
That element also has text in it, though just one character. It's a wrong
approach, but technically it's an element with text content.
Why would this not take effect?
It's pretty futile to discuss that, since the approach is wrong, you didn't
reveal the URL, and you're not telling what you mean by its not taking
effect.
Is there a way that I can stop
inheritence from the ".liCol1 li" section?
There is no such thing as inheritance from a section. Elements may inherit a
property value from their parent. The way to stop that is to assign a value
to the property for that element.

As a rule of thumb, 105 % of all CSS questions with the word "inheritance"
in them are seriously misguided and do not actually deal with inheritance at
all.

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

Feb 1 '07 #4
On Feb 1, 6:30 am, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit hende...@yahoo.com:
I am trying to create/update webpages using CSS and modern
programming (getting away from using tables to place text and
objects).

Whether you use modern programming is immaterial. CSS is not programming,
though you can write programs that generate, read, modify, or interpret CSS
code.

There is nothing wrong with using tables when you have tabular data. Whether
an address is tabular data is debatable, but the fact is that there are
authors who are "getting aways from using tables" in vain, even making their
pages less logical and more difficult to maintain.
I am running into an issue using ul's.

When you have run into an issue with CSS, it's virtually always a waste of
everyone's time to post a question without revealing the URL.
I will give you the code below:

You are not giving yourself good chances of getting the help you need.
<ul class="liCol1">
<li>Vendor name</li>
<li>Address</li>
<li>City St, Zip</li>
<li>Phone number</li>
<li class="liSpacer">&nbsp;</li>
<li>Data directory</li>
<li>Temp directory</li>
<li class="liSpacer">&nbsp;</li>
<li>DSA keys</li>
</ul>

What's "liCol1"? Class names should be descriptive of meaning and structure,
not cryptic codes for intended formatting.

Why the spacer items? Use vertical margins instead.
and here is the css from an external file:
.ulCol1 {
list-style: none;
text-decoration: none;
margin: 0px;
padding: 0px;
}

Why do you present this snippet? There is no class "ulCOl1" in your markup
snippet.
.liCol1 li {
margin: 4 0 0 0;
height: 17px;
}

4 of what? Did you forget to use the "CSS Validator" to check whether your
style sheet is even formally correct? Why 17px? The px unit should normally
be used in user style sheets only. Why do you set the height in the first
place?
.liSpacer {
margin: 0px;
padding: 0px;
height: 12px;
font-size: 10px;
}

Instead, assign a class to an item after which some spacing is desired, and
simply set e.g. margin-bottom: 1em for it.
This works just fine

No it doesn't.
for the li's that have text in them. The ones
that have the class="liSpacer" don't seem to use css that is given.

That element also has text in it, though just one character. It's a wrong
approach, but technically it's an element with text content.
Why would this not take effect?

It's pretty futile to discuss that, since the approach is wrong, you didn't
reveal the URL, and you're not telling what you mean by its not taking
effect.
Is there a way that I can stop
inheritence from the ".liCol1 li" section?

There is no such thing as inheritance from a section. Elements may inherit a
property value from their parent. The way to stop that is to assign a value
to the property for that element.

As a rule of thumb, 105 % of all CSS questions with the word "inheritance"
in them are seriously misguided and do not actually deal with inheritance at
all.

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


Jukka,

I am not sure how to take your response to my post. If it was
meant as a sincere reply explaining certain aspects, then I will
appreciate it. If you were responding with an attitude towards
someone who is trying to learn correct ways of coding, then I would
ask you not to reply.

Feb 1 '07 #5
On Feb 1, 3:37 am, Ben C <spams...@spam.eggswrote:
On 2007-02-01, hende...@yahoo.com <hende...@yahoo.comwrote:
Gang,
I am trying to create/update webpages using CSS and modern
programming (getting away from using tables to place text and
objects). I am running into an issue using ul's. I will give you the
code below:

[snip]
.liCol1 li {
margin: 4 0 0 0;
height: 17px;
}
.liSpacer {
margin: 0px;
padding: 0px;
height: 12px;
font-size: 10px;
}
This works just fine for the li's that have text in them. The ones
that have the class="liSpacer" don't seem to use css that is given.

It looks like .liCol1 li is more "specific" than .liSpacer. See CSS 2.1
6.4.3.
Why would this not take effect?

If you make ".liSpacer" ".liCol1 li.liSpacer" instead, it will become
more specific (two classes and one element beats one class and one
element).
Is there a way that I can stop inheritence from the ".liCol1 li"
section? Any help would greatly be appreciated.

Not that I know of. You can give all the non-spacer <li>s their own
class and then you can select them with a selector that won't match the
spacers as well. Otherwise override everthing you set in .liCol1 li in
.liCol1 li.liSpacer to set it back to the default.

Thanks guys for the input. I will play around with what you suggested
and see if I can get things working.

Feb 1 '07 #6
Scripsit he******@yahoo.com:
Jukka,
We are not in a first-name basis, especially since you are cowardish enough
to hide yours.
I would ask you not to reply.
By fullquoting a useful answer and by not addressing any of the concerns
there, including the absence of a URL, you already asked all knowledgeable
people to ignore your further posts.

HTH. HAND.

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

Feb 1 '07 #7
On 2007-02-01, he******@yahoo.com <he******@yahoo.comwrote:
On Feb 1, 6:30 am, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
[snip]
>As a rule of thumb, 105 % of all CSS questions with the word "inheritance"
in them are seriously misguided and do not actually deal with inheritance at
all.

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

Jukka,

I am not sure how to take your response to my post. If it was
meant as a sincere reply explaining certain aspects, then I will
appreciate it. If you were responding with an attitude towards
someone who is trying to learn correct ways of coding, then I would
ask you not to reply.
Don't worry about Mr Korpela. He has a certain asperity, but makes good
technical points and my impression is that he is not really a bully.
Feb 1 '07 #8
On Feb 1, 2:14 pm, Ben C <spams...@spam.eggswrote:
On 2007-02-01, hende...@yahoo.com <hende...@yahoo.comwrote:
On Feb 1, 6:30 am, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
[snip]
As a rule of thumb, 105 % of all CSS questions with the word "inheritance"
in them are seriously misguided and do not actually deal with inheritance at
all.
--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
Jukka,
I am not sure how to take your response to my post. If it was
meant as a sincere reply explaining certain aspects, then I will
appreciate it. If you were responding with an attitude towards
someone who is trying to learn correct ways of coding, then I would
ask you not to reply.

Don't worry about Mr Korpela. He has a certain asperity, but makes good
technical points and my impression is that he is not really a bully.


Thats why I worded my post the way I did... basically if you are being
helpful and not a bully thank you... if not keep to yourself. Thanks
again for your help. I tried doing what you said and it worked out
perfectly. Have a good one.

Feb 1 '07 #9
<he******@yahoo.comwrote in message
news:11**********************@a34g2000cwb.googlegr oups.com...
On Feb 1, 2:14 pm, Ben C <spams...@spam.eggswrote:
I am not sure how to take your response to my post. If it was
meant as a sincere reply explaining certain aspects, then I will
appreciate it. If you were responding with an attitude towards
someone who is trying to learn correct ways of coding, then I would
ask you not to reply.

Don't worry about Mr Korpela. He has a certain asperity, but makes good
technical points and my impression is that he is not really a bully.

Thats why I worded my post the way I did... basically if you are being
helpful and not a bully thank you... if not keep to yourself. Thanks
again for your help. I tried doing what you said and it worked out
perfectly. Have a good one.
Geniuses have a tendency to "talk at" or "down" to you without an implied arrogance or
measure of disrespect.

Taking it personally on a newsgroup though only makes you look even sillier.

Take your own advice and just do not respond to Jukka when you feel he is being
overbearing. (He is definitely smart though, so pay attention to him at least.)

Just my $0.02. And no, I do not have an attitude just in case your first thought is to
reply as such.

Be well.

-Lost
Feb 2 '07 #10
hh*******@yahoo.com wrote:
Gang,

I am trying to create/update webpages using CSS and modern
programming (getting away from using tables to place text and
objects). I am running into an issue using ul's. I will give you the
code below:

<ul class="liCol1">
<li>Vendor name</li>
<li>Address</li>
<li>City St, Zip</li>
<li>Phone number</li>
<li class="liSpacer">&nbsp;</li>
<li>Data directory</li>
<li>Temp directory</li>
<li class="liSpacer">&nbsp;</li>
<li>DSA keys</li>
</ul>

and here is the css from an external file:

.ulCol1 {
list-style: none;
text-decoration: none;
margin: 0px;
padding: 0px;
}

.liCol1 li {
margin: 4 0 0 0;
height: 17px;
}

.liSpacer {
margin: 0px;
padding: 0px;
height: 12px;
font-size: 10px;
}

This works just fine for the li's that have text in them. The ones
that have the class="liSpacer" don't seem to use css that is given.
Why would this not take effect? Is there a way that I can stop
inheritence from the ".liCol1 li" section? Any help would greatly be
appreciated.

Also note, that there may be several of these on a page so I was
trying to avoid giving each ul an id.
Try this.

..liSpacer {
list-style-type:none;
}
Feb 2 '07 #11

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

Similar topics

163
by: Shiperton Henethe | last post by:
Hi Know any good utilities to help me strip out the tags that Microsoft Excel 2002 leaved behind when you try and export an HTML format file? This is driving me NUTS. And really makes me...
12
by: Oberon | last post by:
I have a large HTML document. It has hundreds of <span>s which have no attributes so these <span>s are redundant. How can I remove these tags automatically? The document also has <span>s with...
2
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not...
10
by: Coleen | last post by:
Hi all :-) I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML. Here is the snippet of code for the cell I'm trying to format: Dim...
2
by: jodyblau | last post by:
I'm not certain that what I am trying to do is possible; in any event I haven't been able to figure it out. Here is what I am trying to do: I have one table that has a list of cases I'm working...
11
by: Robert W. | last post by:
Here's some pseudo-code that describes what I'm trying to do: foreach(object in collection) { if (certain-condition) collection.Remove(object); } The problem with this is that foreach gets...
1
by: aman909 | last post by:
Hello, Im trying to use conditional formatting in a text box on a form. What im trying to do is that conditional formatting changes the colour of the text in the text box. I need the...
3
by: Rainer Queck | last post by:
Hello NG, is it possible to use linq to remove certain objects from a generic list? Something more or less like: from obj in MyList where obj.Id 25 delete obj
2
Pittaman
by: Pittaman | last post by:
Hello I am creating some crystal reports (for visual studio 2005) based on the content of certain .NET objects. I'm doing this in .NET 2.0. For one of them I'm using a Cross-table to summarize...
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: 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,...
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.