Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Link css help  (Read 11777 times)

0 Members and 1 Guest are viewing this topic.

nymph4

    Topic Starter


    Specialist

    Link css help
    « on: April 09, 2010, 08:00:15 PM »
    I think I am getting the hang of Exturnale  CSS

    The page with all the  CSS  code I saved as
    test.css

    And every page in the <header> Tags I put
    <link ref="stylesheet" type="text/css" href="test.css"/>

    And I have them both in the same directory??

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Link css help
    « Reply #1 on: April 10, 2010, 11:21:23 AM »
    Quote
    And every page in the <header> Tags I put
    <link ref="stylesheet" type="text/css" href="test.css"/>

    And I have them both in the same directory??
    Yes, but they don't have to be.

    nymph4

      Topic Starter


      Specialist

      Re: Link css help
      « Reply #2 on: April 10, 2010, 12:59:57 PM »
      Now one thing
       all my pages have
      <link ref="stylesheet" type="text/css" href="test.css"/>

      In the head  tags

      and the page with all the  css  code that they link to in called    test.css and I have it in th same directory.

      But my pages are not showing the  image as the background they all  White  and the color  should be  Black if the image can't show.

      And nothing els  works right  the Text is black  should be  wight.

      So I don't think I am linking to the  test.css file  right

      Sould I have not  /  at the end of
      <link ref="stylesheet" type="text/css" href="test.css"/>      or am I missing something

      soybean



        Genius
      • The first soybean ever to learn the computer.
      • Thanked: 469
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 10
      Re: Link css help
      « Reply #3 on: April 10, 2010, 02:36:12 PM »
      Quote
      link ref="stylesheet"
      Change ref to rel.

      nymph4

        Topic Starter


        Specialist

        Re: Link css help
        « Reply #4 on: April 16, 2010, 01:21:51 PM »
        Thanks for all you help I now use this as the  CSS exturnale code

        body {
        background-color:#00000;
        background-image:url(wall.jpg);
        background-repeat:repeat;
        }
        a:link {
        color:#FFFF00;
        }
        a:visited {
        color:#FFFF00;
        }
        p{
        font-family:times new roman,Arial;
        font-size:25px;
        color:#FFFFFF;
        }
        h1 {
        font-family:times new roman,Arial;
        font-size:100px;
        color:#FFFFFF;
        }
        And it works but it puts the same image on every html page I have and I get this.
        But what if I want say one image called  leaf.jpg  just to be used as the background on just the   fall.html  page??

        kpac

        • Web moderator
        • Moderator


        • Hacker

        • kpac®
        • Thanked: 184
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 7
        Re: Link css help
        « Reply #5 on: April 16, 2010, 01:30:25 PM »
        Just add this to the head of your page, "fall.html".

        Code: [Select]
        <style type="text/css">
        body {
          background-image: url(leaf.jpg);
        }
        </style>

        nymph4

          Topic Starter


          Specialist

          Re: Link css help
          « Reply #6 on: April 16, 2010, 01:53:41 PM »
          OK so if I ad

          <style type="text/css">
          body {
            background-image: url(leaf.jpg);
          }
          </style> to the Head Tag I get how this works.

          Then how is this diferant or batter then if I just added an 
          HTML  <backgroun ="leaf.jpg">
          to the page  you know the code that  was used with  HTML????

          Or if I stick with
          <style type="text/css">
          body {
            background-image: url(leaf.jpg);
          }
          </style>

          It is faster to load??

          kpac

          • Web moderator
          • Moderator


          • Hacker

          • kpac®
          • Thanked: 184
            • Yes
            • Yes
            • Yes
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 7
          Re: Link css help
          « Reply #7 on: April 16, 2010, 02:00:02 PM »

          soybean



            Genius
          • The first soybean ever to learn the computer.
          • Thanked: 469
          • Computer: Specs
          • Experience: Experienced
          • OS: Windows 10
          Re: Link css help
          « Reply #8 on: April 16, 2010, 02:22:17 PM »
          You could use either inline or embedded styles in this case but I think embedded, as kpac suggested, is the better choice in this case.  Reference on Types of CSS Styles (inline, embedded, external): http://webdesign.about.com/od/css/qt/aatypesofcss.htm

          nymph4

            Topic Starter


            Specialist

            Re: Link css help
            « Reply #9 on: April 17, 2010, 11:58:15 AM »
            Soory what I ment to say is

            Thanks for the help.

            So if I put the  CSS  code in the Header Tags  for the background image  or if I use  HTML  code
            <BODY BACKGROUND="Leaf A1.JPG">

            Witch is  batter or what will hapen?

            If I use the old   <BODY BACKGROUND="Leaf A1.JPG">    will it do something  to the page  because the rest of it is in  CSS???

            Or if I use  CSS  in the head  tags  to place  the background image it will load faster???

            What is going on

            kpac

            • Web moderator
            • Moderator


            • Hacker

            • kpac®
            • Thanked: 184
              • Yes
              • Yes
              • Yes
            • Certifications: List
            • Computer: Specs
            • Experience: Expert
            • OS: Windows 7

            soybean



              Genius
            • The first soybean ever to learn the computer.
            • Thanked: 469
            • Computer: Specs
            • Experience: Experienced
            • OS: Windows 10
            Re: Link css help
            « Reply #11 on: April 17, 2010, 04:32:41 PM »
            If I use the old   <BODY BACKGROUND="Leaf A1.JPG">    will it do something  to the page  because the rest of it is in  CSS???
            Yes, it will display the background image in the page.  But, as the reference cited by kpac says, "This is the old way of specifying a background image in HTML, and is now deprecated (outdated and not recommended) by the W3C. Instead of using this method, you should use the CSS method ..."

            Or if I use  CSS  in the head  tags  to place  the background image it will load faster???
            No, but see above quote from the reference.

            Big



              Beginner

              Thanked: 4
              • Experience: Experienced
              • OS: Windows XP
              Re: Link css help
              « Reply #12 on: April 20, 2010, 07:39:21 AM »
              "Or if I use  CSS  in the head  tags  to place  the background image it will load faster???" -> you mean <style type="text/css"></style>, right? I don't know, let's ask the people here. As far as I see it, no one has yet said if the page will load faster as opposed to an external CSS file. I would say that the internal style (head) is faster because it doesn't have to go search for an external file. I might be wrong though.
              Computerhope is corrupt.

              kpac

              • Web moderator
              • Moderator


              • Hacker

              • kpac®
              • Thanked: 184
                • Yes
                • Yes
                • Yes
              • Certifications: List
              • Computer: Specs
              • Experience: Expert
              • OS: Windows 7
              Re: Link css help
              « Reply #13 on: April 20, 2010, 10:03:45 AM »
              Quote
              I would say that the internal style (head) is faster because it doesn't have to go search for an external file. I might be wrong though.
              You're not wrong. But if the CSS file is downloaded externally once, the browser will store it in the cache so it doesn't need to download it again.

              Big



                Beginner

                Thanked: 4
                • Experience: Experienced
                • OS: Windows XP
                Re: Link css help
                « Reply #14 on: April 20, 2010, 10:21:03 AM »
                Then the question is: if stored in the cache, is it faster than inline style (head)?
                Computerhope is corrupt.