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 12 of 12
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation Text highlighting code

    I want to be able to highlight my text, thats all. I would have thought it would be something like
    font-hightlight: ffffff

    but I cant figure it out. And when I do get something to work it just makes the whole background that color :S But i just want it to highlight the text, like you can do in micro soft. if anyone knows a simple html font code for that, that would be great.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Hello fairybusiness,
    Not sure there's any such thing as font-hightlight.

    Does this work for you? The bits in red are what does it:
    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 {
    	font: 14px/14px "Comic Sans MS";
    	background: #FC6;
    	text-align: justify;
    }
    * {
    	margin: 0;
    	padding: 0;
    	border: none;
    }
    #wrap {
    	width: 800px;
    	margin: 30px auto;
    	background: #999;
    	overflow: auto;
    }
    p {
    	margin: 10px 20px;
    }
    .hlighted {
    	background: #fff;
    }
    </style>
    </head>
    <body>
        <div id="wrap">
                <p>
                    Lorem ipsum dolor sit amet, <span class="hlighted">consetetur sadipscing elitr,</span> 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. 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 wrap--></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 to the CF scene
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the reply, but could you put the code into this form?

    }
    table, tr, td, li, p, div {
    color:ffffff;
    font-size:13pt;
    font-family:Times New Roman;

    }

    That is what I have at the begining of my myspace layout code. I know this code <span style="background-color: COLOR">TEXT</span> but thats only to highlight certain parts, I want to highlight all of the text. If you know a code for this, please let me know!!

  • #4
    Regular Coder
    Join Date
    Nov 2006
    Posts
    247
    Thanks
    13
    Thanked 26 Times in 24 Posts
    Do like Excavator showed, just wrap all the text in the span or p tag.

    Code:
    <style type="text/css">
    .hlighted {
    	background: #fff;
    }
    </style>
    and
    Code:
    <p>
                    <span class="hlighted">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. 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>
    </p>
    or

    Code:
    <p class="hlighted">
                    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. 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>
    This is probably the best that can be offered for a Myspace layout
    Last edited by Majoracle; 02-24-2009 at 11:58 PM.

  • #5
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    I suspect this probably won't work as you want it. All of those are block-level elements, so it will be the background of the block instead of the text, as you said. You can always try making them display inline, but MySpace is in quirks mode, so the result is going to be unpredictable at best.

  • #6
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    are you really talking about when you click and drag your cursor over text how the background turns one color and the text another?

    Code:
    ::selection { background: #00B4E0; color: #10161D; /* Safari */ }
    ::-moz-selection { background: #00B4E0; color: #10161D; /* Firefox */ }
    but IE won't understand.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #7
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    I think he's just talking about a background on text like this.

  • #8
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts
    I've done it by using <span class="highlight">highlighted text</span> in the actual text itself. Of course you'll need to define .highlight as a class. What I did was search for a word, say "Ship" and replace it with <span class="highlight">Ship</span> and that did the job. I did this using PHP so it was easy to search and replace the "Ship" text.
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #9
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,749
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    I don't know tables and, from the tiny snippet you provide, it's hard to tell what your layout is like. It sounds like you just want a background color...
    Try this:
    Code:
    }
    table, tr, td, li, p, div { 
    color:ffffff; 
    font-size:13pt; 
    font-family:Times New Roman;
    background: #fff;
    }
    If that doesn't put it in the right place we may need to see the rest of your code.
    Last edited by Excavator; 02-25-2009 at 02:58 AM.
    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

  • #10
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Well, I am putting this into a myspace code, so I'm not sure you want to see the rest of my myspace code. But I am making layouts for other people, so that is why I cant apply the background color code to their paragraphs b/c I dont know where and what they will be. That is why I need to have all of the codes inside of the myspace layout code, so that all they have to do is paste it into there myspace and write.

    table, tr, td, li, p, div {
    color:ffffff;
    font-size:13pt;
    font-family:Times New Roman;
    }

    That is just the only area that affects the regular inputted text. I tried text-highlight: but that didnt work. And the thing is, is that its a table, not a class, so if i just put background-color: it affects the whole table, and does not highlight.

  • #11
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    Note several posts have shown:

    color: #ffffff;

    Also the correct font family is:
    font-family: "Times New Roman";

    When a font has spaces in the name, it has to be enclosed in quotes.
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

  • #12
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    actually Jerry, myspace eats #'s for lunch. so color: fff is actually correct in this case *le sigh

    fairybusiness,

    make a myspace account and try what you tried and then post a link. it will help all of us try to understand exactly what you want and you'll get better answers.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis


  •  

    Posting Permissions

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