CSS:multiple classes in one declaration?

L

Leslie

I hope this question makes sense; I'm getting kind of mush
brained......

Can I use multiple classes in one declaration? At a client's request
I'm setting apart sections of a page with:

<style type="text/css">
p.double {border-style: double}
</style>

<p class="double">Important Text goes here</p>

Below this is a list (using <ul>) of items that further breaks down
the info in Important Text. I've got the top & bottom margin for <ul>
set at 0, but I'm getting an unwanted space between the Important Text
and the list. I want just a line break, not a paragraph break.

Can I add a second class to <p> to set the bottom margin, and if so,
how do I do it?

Thanks!!

Leslie
 
A

Adrienne

I hope this question makes sense; I'm getting kind of mush
brained......

Can I use multiple classes in one declaration? At a client's request
I'm setting apart sections of a page with:

<style type="text/css"> p.double {border-style: double} </style>

<p class="double">Important Text goes here</p>

Below this is a list (using <ul>) of items that further breaks down
the info in Important Text. I've got the top & bottom margin for <ul>
set at 0, but I'm getting an unwanted space between the Important Text
and the list. I want just a line break, not a paragraph break.

Can I add a second class to <p> to set the bottom margin, and if so,
how do I do it?

Thanks!!

Leslie

<style type="text/css"> p.double {border-style: double; margin-bottom:0}
</style>
 
L

Leslie

<style type="text/css"> p.double {border-style: double; margin-bottom:0}
</style>


Thanks, Andrienne! That's exactly the look I want.

I've got so much to learn about CSS!! I'm trying to incorporate as
much as I can into a site that I took over last year. It's a large
site and all pages have table based layout. As I add new pages I'm
trying to make them all CSS, but it's tough when I'm still very early
in the CSS learning process and facing deadlines for the site. It's
a challenge, but I'm learning a lot from my questions here, and from
others' questions.

Thank you again!

Leslie
 
M

Mark Nobles

Gazing into my crystal ball I observed Leslie said:
writing in
How about this:
<p style="margin-bottom:0; border-style: double;">
Important
</p>
<ul style="margin-top:0">
<li>what</li>
<li>why</li>
</ul>

Works for me. Perhaps it's your browser is not in standards mode.

What you might like better is something like

<div style="border-style: double;">
<p style="margin-bottom:0;">Important Text goes here</p>
<ul style="margin-top:0">
<li>what</li>
<li>why</li>
</ul>
</div>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top