Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18

Thread: CSS Help

  1. #1
    Member
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    40
    Member #
    759
    Hi there Guys.

    Ok I've only been learning css for two days now, and I'm still a bit daunted about the whole thing.

    I Know to attach a css sheet I nee to use this :
    <LINK rel="stylesheet" type="text/css" name="anyname" href="url">

    Please bare with me here a little whilst i try to explain a little further.

    I also understand stand the basic structure of the css sheet which I presume is this :

    body

    {

    font-family: Verdana, "Minion Web", Helvetica, sans-serif;

    font-size: 1em;

    text-align:justify;

    }


    The whole Above is the STATEMENT which can be many in number in a css sheet ,the Body =SELECTOR and the content inside the curly braces is the DECLARATION.

    Now here is where I get stuck.
    How do I assign the styles to lets say a paragraph of any other text element on my webpage? Do i need to insert a tag of some sort at the start of the element to be changed?

    Plaese help me.

    Any refered books or even urls on this subject would be appreciated

    many thanks!!

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    Code:
    <html>
    <head>
    <style type="text/css">
    span.text1 {
    	font-family: Arial;
    	font-size: 20px;
    	color: #000000;
    }
    </style>
    </head>
    <body>
    This is Text Not using the CSS<br>
    <span class="text1">This is Text Using the CSS</span>
    </body>
    </html>
    what you have to do is put the tag you want to be used first - in this case <span> then the name of the class which here is text1. So it would be span.text1

    It can also be done without the name of the tag - (eg .text1) so it can be attached into any html tag
    JR

  4. #3
    Member
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    40
    Member #
    759
    I tried that and it works fine when the style is embed.


    But how do I assign the styles from a css sheet from an external linked css sheet?


    Cheerz for the help

  5. #4
    Member
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    40
    Member #
    759
    Hope I'm not being burdensome guys!

  6. #5
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    its just the same class="text1" from a external stylesheet - make sure your link is correct though -
    Code:
    <link rel="stylesheet" type="text/css" href="whatever.css">
    That should be in the head section
    JR

  7. #6
    Member
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    40
    Member #
    759
    Thanks man I'll give that a go

  8. #7
    Member
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    40
    Member #
    759
    Still getting a bit lost in all this.

    ok here's what I got:

    1) My head link is thus:<link rel="stylesheet" type="text/css" href="styles/style.css">

    2) On my external .css sheet is this:

    #content {
    margin-top: 50px;
    margin-left: 10px;
    margin-right:199px;
    border: 1px solid #191970;
    padding-left: 40px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 10px;
    font-size:14px;
    color: #191970;
    }
    Lets say I nee to change this "My So hopeless at css"
    would I write it as this:

    <span class="#content ">This is Text Using the CSS</span> ??

  9. #8
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    1. your link is fine
    2.try this
    Code:
    .content {
    margin-top: 50px;
    margin-left: 10px;
    margin-right:199px;
    border: 1px solid #191970;
    padding-left: 40px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 10px;
    font-size:14px;
    color: #191970;
    }
    then link to is like this <span class="content ">This is Text Using the CSS</span>

    Lets say I nee to change this "My So hopeless at css"
    would I write it as this:
    what do you mean by that?
    JR

  10. #9
    Member
    Join Date
    Feb 2003
    Location
    Northern Ireland
    Posts
    40
    Member #
    759
    I'm think begining to crack

    Link reads:
    <link rel="stylesheet" type="text/css" href="styles/style.css">

    External sheet reads:
    .content {
    margin-top: 50px;
    margin-left: 10px;
    margin-right:199px;
    border: 1px solid #191970;
    padding-left: 40px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 10px;
    font:50px/50px verdana, arial, helvetica, sans-serif;
    color:ff0000
    }


    Span tag reads:
    <span class=".content"> This is my text to be changed </span>


    Still no joy though

    What am I doing wrong m8?

  11. #10
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    dont put the full stop (period) in the <span class="content"> do put it in the external stylesheet though
    JR


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:45 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com