...

View Full Version : Resolved change style / colour of text mid-sentence



ahayzen
10-25-2009, 11:42 PM
how can i change the colour / style mid-sentence without using <font> <i> <u> <b> is there an easy way to do this?

Excavator
10-26-2009, 12:10 AM
Hello ahayzen,
I hate inline styling - it's way too hard to debug.
Try styling a span instead.
Have a look at this example -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
font: 14px "Comic Sans MS";
background: #FC6;
}
* {
margin: 0;
padding: 0;
border: none;
}
#container {
width: 800px;
margin: 30px auto;
background: #999;
overflow: auto;
}
.different {
font: 16px Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<div id="container">
<p>
Lorem ipsum dolor sit amet, consetetur <span class="different">sadipscing</span> elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
</p>
<!--end container--></div>
</body>
</html>

ahayzen
10-26-2009, 12:14 AM
kool thx



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum