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"> </li>
<li>Data directory</li>
<li>Temp directory</li>
<li class="liSpacer"> </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/