Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: text manipulate

  1. #1
    New Coder
    Join Date
    Feb 2011
    Posts
    19
    Thanks
    6
    Thanked 0 Times in 0 Posts

    text manipulate

    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.
    Last edited by bigbada; 02-22-2011 at 03:06 AM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,694
    Thanks
    22
    Thanked 1,832 Times in 1,816 Posts
    Hello bidgada,
    See this example using the span tag to target a bit of text in a paragraph.

    Code:
    <!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>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Feb 2011
    Posts
    41
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by bigbada View Post
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •