• Notice regarding image hosts and attachments. See here.

CSS questions

Soldato
Joined
26 Aug 2005
Posts
6,922
Location
UK
Hi guys,

Just wanted to check if this was right

"Stylist all p elements so that their font size is 150% the font size of the parent element, text aligned to the right and the distance between the lines is 1.5 times the font size of the element"

Code:
p > * {font-size:150px; text-align:right; text-space: 1.5x}
 
font-size needs to use a relative unit e.g. %.
Distance between lines is controlled by the line-height property, which is unitless e.g 2.5 = 2.5 x font-size.

The selector is wrong also. p > * targets all children of any <p> element. Just use the element selector i.e. p { }
 
Back
Top Bottom