can i combine two css classes per single html div or span element? -
i have below code doing want, wanted see if can simplify single line , not use 2 html elements
<head runat="server"> <title></title> <style type="text/css"> .firstletter{color:white; background:blue; border:1px black solid; padding-top:10px; padding-left:10px;} .spaced{letter-spacing: 5px;} </style> </head> <body> <form id="form1" runat="server"> <span class="firstletter"> r </span> <span class="spaced"> ealtime account activiation </span> </form> </body> </html>
can away single inline text in html element this:
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .firstletter{color:white; background:blue; border:1px black solid; padding-top:10px; padding-left:10px;} .spaced{letter-spacing: 5px;} </style> </head> <body> <form id="form1" runat="server"> <div class="firstletter spaced"> realtime account activiation </div> <div class=""firstletter spaced""> announcements </div> </form> </body> </html>
you can use pseudo-element :first-letter
achieve need adding right after class .firstletter
of css rule like:
.firstletter:first-letter{color:white; background:blue; border:1px black solid; padding-top:10px; padding-left:10px;}
.
here example using second part of html: http://jsbin.com/eqicu4
of course needs modifications make how it's in first example.
Comments
Post a Comment