Solved

CSS Apply margin to UL inside of a class

Posted on 2010-09-09
4
546 Views
Last Modified: 2013-12-14
Given the code below...

psDesc is from a database (descriptions of products) - it is user generated contenet from a WYSIWYG editor.  In this instance the user has used unordered lists for many products.  The descriptions do not look right because there is no vertical seperation between the end of the UL and the begining of the next paragraph.  I could go through each of the 3000 products and change the properties of the UL, but it seems like there should be an easier way.  

My thought was to add margin-bottom:10px to the UL inside of the "pcShowProductsSDesc" class, and that would fix it.

Looking at the actual text from the WYSIWYG editor, no css properties are set on the UL.

The css i was trying is listed after the code below - it doesn't have an affect on the display.

Any ideas?

Thanks!


<div class="pcShowProductSDesc">
			<%response.Write("<div style='padding-top: 5px;'></div>")%>
			<%=psDesc %>
</div>

'---------------------CSS Below:

	#pcMain .pcShowProductSDesc {
		font-family:Verdana, Geneva, sans-serif;
		color:#00000;
		font-size:12px;
		padding-right: 30px;
	}
	
	#pcmain .pcShowProductSDesc ul{
		margin-bottom:10px;
	}

Open in new window

0
Comment
Question by:slightlyoff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33637761
did you tried this style?
ul li
{
   margin-bottom:5px;
   padding-bottom:3px;
}
0
 
LVL 1

Author Comment

by:slightlyoff
ID: 33637977
Yeah,  it doesn't seem to have an affect.  I played around with the values - changing 5px to 10px and 3px to 10px to see if maybe it just wasn't showing enough... but no luck.



0
 
LVL 3

Accepted Solution

by:
jchook earned 500 total points
ID: 33643801
It's possible that other CSS code (especially in-line style code) is interfering or overriding your changes. Also, I am not seeing any UL elements in the example you gave...

You can try clearing and vertical padding.

ul {
 padding-bottom: 1.5em;
}
p {
 clear: both;
}

If that doesn't work, you can try the !important keyword at the end of the rules. It is a good idea to make the selection more specific in this case though:

ul.productList {
 padding-bottom: 1.5em !important;
}
p {
 clear: both !important;
}
0
 
LVL 1

Author Closing Comment

by:slightlyoff
ID: 33737754
Thank you, that worked :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Link Anchor Not working 9 51
CSS for Popup in ASP.NET 4 19
Embedd an image or live dashboard into Slack 1 17
Boolean 13 25
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question