dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: Background color dissappeared and text colours gone black

Hybrid View

  1. #1
    Join Date
    Apr 2012
    Posts
    110

    Background color dissappeared and text colours gone black

    Hi, I changed <stylesheet type="text/css> to <link rel="stylesheet" style type="text/css" href="styles.css"> so that I could try put the CSS in a external style sheet. But now the text that was red and yellow, has turned black, and the black background has dissapeared.
    I made a folder and called it styles.css. then a text file in the styles.css folder called mainstyles.css

    The code in the mainstyles.css file is body{background-color:black;margin:0px;}
    and h1 {color:red} Nothing is happening.

    Also spufi, chreyani major payne, when I click right click on image the address is c:/users/spencer/Desktop/images
    Is this right, cause I heard that you cant have a path Desktop.
    How do I change this and to what.

    Thanks for the other answers.

  2. #2
    Join Date
    Mar 2012
    Posts
    48
    if you are having .css file named style.css that exist in a folder named 'css'
    what you have to write in your html file is this:
    <link href="css/style.css" rel="stylesheet" type="text/css"/>



    another thing you should know about HTML is that you have the <base></base> tags.
    you can define a base url for you site. (between the <head> tags)
    <base href="http://www.example.com/images/" target="_blank" />
    and now if you put a <img src="smily.jpg" alt="example" />
    will be the same as <img src="http://www.example.com/images/smily.jpg">
    just remember this option exists.

  3. #3
    Join Date
    Apr 2012
    Posts
    110

    Must I delete all the internal css in order for the external to work

    Hi chryaner, still not working, must I delete all the internal css first maybe, Its all a faint black now since I put link in to external css.
    I put this in <link href="stylesheet" style type="text/css" href="mainstyles.css/style.css"/>

    I tried putting styles.css/mainstyles.css in aswell, still doesnt work.

    The mainstyles.css text file is in the styles.css folder.

    The text color hasnt changed to red still and the background still hasnt gone to black.

  4. #4
    Join Date
    Mar 2012
    Posts
    48
    Quote Originally Posted by wildguy2 View Post
    Hi chryaner, still not working, must I delete all the internal css first maybe, Its all a faint black now since I put link in to external css.
    I put this in <link href="stylesheet" style type="text/css" href="mainstyles.css/style.css"/>

    I tried putting styles.css/mainstyles.css in aswell, still doesnt work.

    The mainstyles.css text file is in the styles.css folder.

    The text color hasnt changed to red still and the background still hasnt gone to black.

    if the path of the css file is "c:\folder\anotherfolder\yoursite\css\style.css"
    your html must be one folder down : "c:\folder\anotherfolder\yoursite\indexhtml"
    change you folder's name to "css" and not "mainstles.css" it may be causing error

    here is a tutorial for three ways to insert css. read it carfully.

    the must correct structure of folders to a site is:
    index.html as you main html file
    css folder - all of your css files
    js folder - all of you js files
    images folder - all of your images

  5. #5
    Join Date
    Apr 2012
    Posts
    110

    Now empty boxes now that Ive put in this address.

    Hi Chryaner.

    Is this right, cause now the images have dissappeared and empty boxes.

    Ontop of the editor/ webpage the address says this c:/users/spencer/Bluetooth Software/Documents/CoffeeCup Software/MyWebsites/MYARTMODELS.html

    I put a base under <head>
    <base href="http=//www.ARTMODELS.html/images/models/webtemplate1.jpg" target="blank"/>

  6. #6
    Join Date
    Mar 2012
    Posts
    48
    Quote Originally Posted by wildguy2 View Post
    Hi Chryaner.

    Is this right, cause now the images have dissappeared and empty boxes.

    Ontop of the editor/ webpage the address says this c:/users/spencer/Bluetooth Software/Documents/CoffeeCup Software/MyWebsites/MYARTMODELS.html

    I put a base under <head>
    <base href="http=//www.ARTMODELS.html/images/models/webtemplate1.jpg" target="blank"/>
    sorry, i didnt gave you the link for the tutorial :
    http://www.w3schools.com/css/css_howto.asp

    read it carefully. take the <base> tags aside for now and try to understand the principles of implementing css files to your site

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles