Solved

CSS change text color without line break

Posted on 2010-09-15
3
306 Views
Last Modified: 2012-05-10
On my page I have a line of text. I want one word to be a different color. So I added a new css rule and applied it to the word, but now the text is creating a new line. It looks like this:

Edit content for the
<blue text> Why Join </blue text>
page.

and I want it to look like this:
Edit content for the  <blue text> Why Join </blue text> page.

Below is my CSS and HTML, can someone tell me how to get all of this on one line with the blue text? Thanks.

My page is here: http://www.glowfishtw.com/play3on3/admin_whyjoin_update.aspx

CSS
.admin_page_title {
      font-weight: bold;
      color: #0CF;
}
.admin_content_middle {
      background-image: url(../images/admin_bg_middle.png);
      background-repeat: repeat-y;
      width: 905px;
      padding-top: 5px;
      padding-right: 10px;
      padding-bottom: 5px;
      padding-left: 45px;
      text-align: center;
      font-family: Arial, Helvetica, sans-serif;
      font-size: 24px;
      color: #333;
}

HTML
  <div class="admin_content_middle">Edit content for the
    <div class="admin_page_title">Why Join</div>
page.</div>
0
Comment
Question by:elliottbenzle
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
LZ1 earned 500 total points
ID: 33685568
You will have to add display:inline to the .admin_page_title class.

Divs are block level elements.  You may have wanted to do a span instead honestly.
0
 
LVL 4

Author Closing Comment

by:elliottbenzle
ID: 33685589
Thanks, I've always wondered about  now I know.
0
 
LVL 30

Expert Comment

by:LZ1
ID: 33685924
And knowing is half the battle!  
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
html input 8 43
Css regex 6 38
Change static entered data to dynamic with counter 5 13
CSS DIV Height in Percent 1 9
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question