...

View Full Version : text manipulate



bigbada
02-22-2011, 01:56 AM
Hello,

I am having trouble with a string of a text.. I want to manipulate just a part of him, not all.

Example:

123456

I want 123 bigger fonts then 456 normal..
I was trying to change with css and div, but everytime i change 123 the 456 jump to new line.. i want them together with the old part..

#ss{font-size:400%}
<div id="ss">123</div>456
Here..123 gets bigger, but 456 jumps into new line. How can i keep it together with the 123?



Any suggestions?

Thanks.

Excavator
02-22-2011, 02:18 AM
Hello bidgada,
See this example using the span tag (http://www.w3schools.com/tags/tag_span.asp) to target a bit of text in a paragraph.


<!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 {
background: #FC6;
font: 100% "Arial Black", Gadget, sans-serif;
color: #333;
}
#container {
width: 800px;
margin: 30px auto;
padding: 20px;
background: #999;
}
span {font-size: 2em;}
</style>
</head>
<body>
<div id="container">
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing 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
sea takimata sanctus est Lorem ipsum dolor sit amet. <span>123</span>456 Lorem ipsum dolor sit amet, consetetur sadipscing 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 sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
<!--end container--></div>
</body>
</html>

shankar.adodis
02-22-2011, 04:19 AM
Hello,

I am having trouble with a string of a text.. I want to manipulate just a part of him, not all.

Example:

123456

I want 123 bigger fonts then 456 normal..
I was trying to change with css and div, but everytime i change 123 the 456 jump to new line.. i want them together with the old part..

#ss{font-size:400%}
<div id="ss">123</div>456
Here..123 gets bigger, but 456 jumps into new line. How can i keep it together with the 123?



Any suggestions?

Thanks.
Hi,
Try giving span as shown

<span class="aaa">123</span><span class="bbb">456

i hope this will help you to solve your problem



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum