html - mixing CSS formatting in a single line -
how's standard way mix 2 different text formats using css style sheets? trying following
<span class="cv-first">university of illinois @ urbana-champaign </span> <span class="cv-first-right">aug. 26<sup>th</sup> 2010</span>
where in style sheet put:
.cv-first { font-variant:small-caps; font-family: sans-serif; color: #000000; } .cv-first-right { font-variant:small-caps; font-family: sans-serif; color: #000000; text-align:right; font-style: italic; }
but doesn't work.
update
so found if replace
text-align:right;
by
float: right;
i looking for. second part on right of page.
span inline element : treated part of text aligned in block container
div block element: can floated left or right, whereas text contents aligned
inline elements have no width, therefore text-align has no sense. may override behavior declaring block element , setting width:
.cv-first-right { display: block; /* necesarry applying width */ width: 150px; /* default width 100% */ float: right; /* move 150px right side */ text-align: right; /* align text in 150px right */ }
Comments
Post a Comment