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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -