Solved

CSS change text color without line break

Posted on 2010-09-15
3
302 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now