Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 550
  • Last Modified:

CSS Apply margin to UL inside of a class

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
slightlyoff
Asked:
slightlyoff
  • 2
1 Solution
 
Gurvinder Pal SinghCommented:
did you tried this style?
ul li
{
   margin-bottom:5px;
   padding-bottom:3px;
}
0
 
slightlyoffAuthor Commented:
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
 
jchookCommented:
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
 
slightlyoffAuthor Commented:
Thank you, that worked :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now