+ Reply to Thread
Results 1 to 4 of 4

Thread: css

  1. #1
    usama_rasab13 is offline x10Hosting Member usama_rasab13 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    13

    css

    Please could someone do a tutorial on how to do css scripting Because I have no idea on how to do it

  2. #2
    Anna's Avatar
    Anna is offline I am just me Anna is a name known to allAnna is a name known to all
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,569

    Re: css

    Moved to "Programming Help" as the support section is for help regarding issues with your account not website design/building.
    Do you have trouble reaching your site?
    Check here first: News and Announcements


    Don't forget that x10hosting has an irc server as well. Come and join the fun
    server: irc.x10hosting.com, main channel: #x10hosting
    There's a lot helpful users there if need help building your site

  3. #3
    Dead-i's Avatar
    Dead-i is offline Community Advocate Dead-i has a spectacular aura about
    Join Date
    Aug 2011
    Location
    United Kingdom
    Posts
    1,448

    Re: css

    In order to start coding CSS, you will need to use any of the following methods:

    - Create a new file named with a .css extension (for example: style.css) and then link it by placing this code within your <head> and </head> tags in your HTML document:
    Code:
    <link href="style.css" type="text/css" rel="stylesheet">
    - Instead of the above method you can embed your CSS directly into your HTML code. In between <head> and </head>, enter your CSS code wrapped around <style> and </style>. For example:
    Code:
    <head>
    <style>
    ** Your CSS Code Goes Here ***
    </style>
    </head>
    Okay, now that you are all setup and ready to go, let's start coding. CSS can alter the style of most of the elements in HTML. For example, to change the style of the entire document, you would use the BODY element, since all of the pages visible elements are wrapped in <body> and </body>. In this example, we have used the BODY element to make the background color blue:
    Code:
    body {
    background-color: blue;
    }
    Notice the formatting that CSS uses. All of the style commands are wrapped in { and }, with the element's name before it. In the style commands, the style you wish to modify (in this case, background-color) is set to 'blue' and a semi-colon is there. The ; and the : are essential, however the space between background-color: and blue is not. For example, we could have used background-color:blue; instead (notice no space inbetween) but let's keep our code simple and clean.

    You can also target specific elements of your HTML document. For example, say you have a Paragraph for your content, and a Paragraph for your footer, and you want the style to be different for each one? Well with CSS, you can. You can give your paragraph (or any element for that matter) a name. This is called a 'class'. Let's give our content and footer different classes; for example:
    Code:
    <p class="content">This is our content paragraph</p>
    <p class="footer">This is our footer paragraph</p>
    You can now control these specific elements with CSS using the same way as we did before, but we put a dot before the elements name. In this example, we give the header a text color of red and the footer a color of green:
    Code:
    .header {
    color:red;
    }
    
    .footer {
    color:green;
    }
    You should also remember that CSS is American, so if you live in the United Kingdom, it's color not colour. So now we have mastered the basics of CSS, let's go through an extra. If you don't wish to use classes or HTML elements, then you can embed the CSS code directly into the element using the STYLE tag. Simply give your HTML element a style attribute, and insert your CSS in between the speech marks. For example:
    Code:
    <p style="color:orange;">This is my text</p>
    In the above tutorial, I have guided you through how you can incorporate CSS and the basics of CSS. However, I have not guided you through all the style types (like background-color) as that is beyond this tutorial. However, for all of the style types I recommend you look at W3Schools.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: css

    In other areas, W3Schools is outdated, incomplete and inaccurate. Their CSS section has a few problems of its own, though not as serious. Here are a few alternatives:

    Lastly, CSS isn't a scripting language; it isn't even a programming language. "Scripting" specifically refers to interpreted control languages. They're used to control other programs, either acting as glue code (as in shell scripts) or to automate or extend the functionality of a single application (such as Blender or the GIMP).
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers