Jul 25, 2008

Help With Css

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > CSS (Cascading Style Sheets)

free web hosting

Help With Css

Albus Dumbledore
Ok, well i have this place on my site where i use to use the <font> tag, but now im updating to start using CSS but i have no idea how to define a style like changing the font color without using <div id="IDNAME"></div> and when i use that, it screws up what i want to change colors

ANy idea what i use? lol

Reply

CrazyRob
Just highlight the text you wish to change and then select the css style. Or if your doing it from the code view you can do sommet like <div class=".css_tag">content will nwo be in the css style css tag</div>

To define a font colour you can do it like this:

.css_tag
font-family: "Century Gothic", Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #CCCCCC;

Reply

Thorned Rose
My biggest suggestion. Use an external stylesheet if you're not already! Makes it a heck of easier to change things.

You call the style sheet by putting in the following code into the head section of your page:
CODE
<link rel="stylesheet" type="text/css" href="path to your stylesheet.css" />

In your html put <div id="myfont">text text text</div> for individual and unique elements placed in a block (line-break after) or
<span class="myfont">text text text</span> for several items that use the same css and placed inline (no line-break after).

(As a general rule use id for unique items and class for things that repeat throughout the page. Use div for block elements and span for inline)

Your stylesheet.css would then contain:
CODE
#myfont {
font-family: Verdana, Arial;
font-size: 10px;
color: #ff0000;
line-spacing: 11px;
}

Use # for unique items or . for items used repeatedly. (generally # goes with id and . goes with class)

Whenever you change anything in your stylesheet it will be reflected on your page without having to change any of the html.

There’s a really excellent website at http://www.cssbasics.com/ that can extend your knowledge of CSS.
There’s also some excellent info on positioning at http://www.brainjar.com/css/positioning/
The WC3 has a page with lots of links for CSS: http://www.w3.org/Style/CSS/learning
Here’s a Google video on creating tableless CSS layouts: http://video.google.com/videoplay?docid=-7403771606765531020 (it’s quite long so it will take a while to load. When it does, skip ahead to the 12 minute mark) but it has very good information
And http://www.csszengarden.com/ is a site that demonstrates what you can do just by changing the stylesheet (without changing the html).
Oh and http://www.oswd.org/ has pure CSS website templates free to download (I used these to help me get started with CSS).

I would send you to my own websites but as they also use Joomla, the use of tables might be confusing.

Let me know if you need any other help. I know how daunting css can be when you start out, but I have been using it for a while now to make complete css based websites and I would never go back! smile.gif

 

 

 


Reply

Albus Dumbledore
@rob

thanks, but like i said in my post i tried that, and it made some nasty line breaks that i don't want/like

@thorned rose

thanks, the <span class="classname">Text</span> worked for me XD and i allready knew about the calling of the CSS but thanks biggrin.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics
Looking for css

Searching Video's for css
advertisement



Help With Css



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE