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

Author Topic: css help  (Read 7575 times)

0 Members and 1 Guest are viewing this topic.

nymph4

    Topic Starter


    Specialist

    css help
    « on: August 28, 2010, 05:25:26 PM »
    I have this code in my Head Tags
    p{color:white;font-family:Times New Roman, Arial;}

    So right before I start typing I type <p>
    Then I type what I want on the page.

    But the txt looks black when I look at it why?????

    reddevilggg



      Expert

      Thanked: 69
    • Experience: Beginner
    • OS: Windows 7
    Re: css help
    « Reply #1 on: August 28, 2010, 06:14:45 PM »

    What are you using, notepad, dreamweaver???

    which text looks black??? Your head tags?? The txt after the <p> tag.

    Have you tried to type something and see if it works first???
    11 cheers for binary !

    nymph4

      Topic Starter


      Specialist

      Re: css help
      « Reply #2 on: August 28, 2010, 07:46:59 PM »
      I use notepad to do all my HTML and CSS

      I put this were it should go in the Head tags
      p{color:white;font-family:Times New Roman, Arial;}


      And if I type in the Body of the page and use the <p>  before my text   it will have an efect on it.

      But the txt I am puting the <p> infront of is in a Dada Cell a Table. And  it has no efect on the txt in the Cell. But if the text is not in a Cell it works??????????

      reddevilggg



        Expert

        Thanked: 69
      • Experience: Beginner
      • OS: Windows 7
      Re: css help
      « Reply #3 on: August 28, 2010, 11:44:45 PM »

      What is 'Dada Cell', i'm thinking you might mean Data Cell

      Have you got a background color because if you want your text in white, it will not show.

      Have you tried to use the <font> container tag with a color attribute?
      11 cheers for binary !

      kpac

      • Web moderator
      • Moderator


      • Hacker

      • kpac®
      • Thanked: 184
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 7
      Re: css help
      « Reply #4 on: August 29, 2010, 02:53:31 AM »
      Post all your code.

      nymph4

        Topic Starter


        Specialist

        Re: css help
        « Reply #5 on: August 29, 2010, 10:46:57 AM »
        got it to work

        reddevilggg



          Expert

          Thanked: 69
        • Experience: Beginner
        • OS: Windows 7
        Re: css help
        « Reply #6 on: August 29, 2010, 02:44:43 PM »

        Would be nice to know how!!!
        11 cheers for binary !

        nymph4

          Topic Starter


          Specialist

          Re: css help
          « Reply #7 on: August 29, 2010, 04:43:34 PM »
          Well I found out that you have to tell it what Table Cell has the text you want to have an efect on.
          Give it a Class name  in the Head tags.

          But I never could get the hange of that so I did inline  css to  change font type

          nymph4

            Topic Starter


            Specialist

            Re: css help
            « Reply #8 on: September 05, 2010, 11:31:04 AM »
            I use this CSS Inline Code and it works

            <p style="color:white;font-family:Times New Roman,Arial;font-size:20px">

            But I just want to know do I have my " in the right place and do I have my ; and : in the right Place??????

            reddevilggg



              Expert

              Thanked: 69
            • Experience: Beginner
            • OS: Windows 7
            Re: css help
            « Reply #9 on: September 05, 2010, 02:32:00 PM »

            Yes, your colons and semicolons are in the right place, but surely trial and error work also. If it doesn't work one way then try the other!!
            11 cheers for binary !

            nymph4

              Topic Starter


              Specialist

              Re: css help
              « Reply #10 on: September 06, 2010, 12:20:25 PM »
              And far as Internal Headline Code goes

              h1 {color:white;font-family:Times New Roman,Arial;}

              This code I thought goes inbetween the Head Tag.

              And when I type my Headline  I just put <h1>   my text and then  </h1>   in the body Tags.

              But when I look at it in a broswer I see
              h1 {color:white;font-family:Times New Roman,Arial;}
              at the top of my page.

              What am I not getting?


              reddevilggg



                Expert

                Thanked: 69
              • Experience: Beginner
              • OS: Windows 7
              Re: css help
              « Reply #11 on: September 07, 2010, 08:32:21 AM »

              Is this inside the 'style type' also, which is inside the <head> tags

              <style type="text/css">

              h1 {color:white;font-family:Times New Roman,Arial;}

              </style>

              11 cheers for binary !

              nymph4

                Topic Starter


                Specialist

                Re: css help
                « Reply #12 on: September 07, 2010, 01:18:41 PM »
                yes

                reddevilggg



                  Expert

                  Thanked: 69
                • Experience: Beginner
                • OS: Windows 7
                Re: css help
                « Reply #13 on: September 07, 2010, 01:25:02 PM »

                Not sure then, i'd have to see to whole code.
                11 cheers for binary !

                Big



                  Beginner

                  Thanked: 4
                  • Experience: Experienced
                  • OS: Windows XP
                  Re: css help
                  « Reply #14 on: September 09, 2010, 12:54:14 PM »

                  Hi nymph4.

                  How's it going with your code, meanwhile?
                  I've taken a look at your code, copied it and tried to see what the problem was.

                  I've managed to get your code to work (meaning, you won't see anything other than your formatted h1 text on the page).

                  The reason why you see "h1 {color:white;font-family:Times New Roman,Arial;}" at the top of your page, I'm not sure why. I think that the browser is treating it as normal text since it isn't between any tags <>.
                  Again, I'm not sure, but it looks like it. I just know that <head></head> contains meta-data.
                  Your browser won't know what to do with all this h1 code unless it's told what type of code it is (text/css).

                  Anyway, I've tried your code and I will show you a not working example and a working example.

                  (your) not working example:

                  Code: [Select]
                  <html>
                  <head>
                  <title>
                  Test Headers
                  </title>
                  h1
                  {
                  color: red;
                  font-family: Times New Roman, Arial;
                  }
                  </head>

                  <body>
                  <h1>test</h1>

                  </body>
                  </html>

                  My working example (red foreground color for the h1 text):

                  Code: [Select]
                  <html>
                  <head>
                  <title>
                  Test Headers Red Font color
                  </title>
                  <style type="text/css">
                  h1
                  {
                  color: red;
                  font-family: Times New Roman, Arial;
                  }
                  </style>
                  </head>

                  <body>
                  <h1>test</h1>

                  </body>
                  </html>

                  Please don't forget that if you have 'color: white;' and you don't specify a background color
                  in the body tag (<body bgcolor="black">),
                   that your white text will be invisible against the white background (naturally, white on white).

                  So to illustrate this, I have put your white text against a black background:

                  Code: [Select]
                  <html>
                  <head>
                  <title>
                  Test Headers White on Black
                  </title>
                  <style type="text/css">
                  h1
                  {
                  color: white;
                  font-family: Times New Roman, Arial;
                  }
                  </style>
                  </head>

                  <body bgcolor="black">
                  <h1>test</h1>

                  </body>
                  </html>

                  So yep, it works. Try my code out and see for yourself.
                  For future reference, please note that it's better to read a comprehensive book on HTML/CSS/languageYouWantToLearn if you want to make good progress (I'm not saying it's the ideal way).
                  Good books usually explain you HTML/CSS in depth and then you get to understand the why's and hows etc.


                  Big


                  Computerhope is corrupt.

                  nymph4

                    Topic Starter


                    Specialist

                    Re: css help
                    « Reply #15 on: September 09, 2010, 04:08:19 PM »
                    This is what I was doing.

                    <HTML>
                    <HEAD>
                    <style type="text/css">
                    h1
                    {
                    text-decoration:underline;color:white;font-family:Times New Roman,Serif;
                    }
                    </style>
                    </HEAD>
                    <body bgcolor="#ffffff" background="wall.jpg">

                    <h1>My headline text I type</h1>
                    </BODY>

                    This sould work right? This is my whole code I was useing I just found it??

                    Big



                      Beginner

                      Thanked: 4
                      • Experience: Experienced
                      • OS: Windows XP
                      Re: css help
                      « Reply #16 on: September 09, 2010, 04:44:49 PM »

                      Yes that should work.
                      Alright just for the record, you forgot the end HTML tag, which is </HTML>.
                      Put it at the end please. I know browsers still understand your code without it, but it's better to put it.

                      I changed your code a bit:

                      color:red;

                      Then it looks like this , because I don't have your background image called wall.jpg. This image should be in the same folder as your html file.

                      Please change text color to red, or your background color to #000000 (black), or you won't be able to see your text. I think that is your problem. =)

                      Big
                      Computerhope is corrupt.

                      reddevilggg



                        Expert

                        Thanked: 69
                      • Experience: Beginner
                      • OS: Windows 7
                      Re: css help
                      « Reply #17 on: September 09, 2010, 04:49:27 PM »
                      Please change text color to red, or your background color to #000000 (black), or you won't be able to see your text. I think that is your problem. =)

                      Big


                      I think that is the problem, i've just checked it in 2 browsers (IE and FF) and nothing showed up.

                      @ Nymph4, But would it not be easier to just check it, other than posting asking for someone else to check it and wait for a reply. ??
                      « Last Edit: September 09, 2010, 05:00:15 PM by reddevilggg »
                      11 cheers for binary !

                      nymph4

                        Topic Starter


                        Specialist

                        Re: css help
                        « Reply #18 on: September 09, 2010, 10:27:34 PM »
                        OK I did not forget the  </HTML>  in my web page I forgot to post it up here.

                        And my photo is of a Stone Wall and my text for my Headline is white.

                        And this code is what shows up on my page as text and not as HTML and not hidden.
                        I realy think maybe I am missing a  ;  or :  or something

                        Big



                          Beginner

                          Thanked: 4
                          • Experience: Experienced
                          • OS: Windows XP
                          Re: css help
                          « Reply #19 on: September 10, 2010, 04:21:52 AM »

                          Alright, a few questions..

                          1) Printscreen please

                          2) What browser are you using precisely (version)

                          3) Did you save your file as mypage.html or mypage.html.txt (to see the file's full name, go to 'My Computer' -> 'Tools' -> 'Folder Options' -> 'View' -> uncheck 'Hide extensions for known file types', click 'Ok', then go to the directory where your .html file is and see if it's .html or .html.txt)

                          4) CSS syntax is like this:

                          ElementName
                          {
                              attributeName: value;
                          }

                          Not really hard to understand. A semicolon is used in most languages as a seperator, a sort of 'Enter'.
                          That's all. Try to use this style, it's more readable.

                          5) Is it a white stone wall?

                          6) Is your stone wall actually displayed on the page?

                          5 & 6 need a printscreen. lol


                          Quote
                          And this code is what shows up on my page as text and not as HTML and not hidden.
                          Your whole code or just that CSS line?

                          Please answer all the questions so we can further help you better.


                          Big
                          Computerhope is corrupt.

                          kpac

                          • Web moderator
                          • Moderator


                          • Hacker

                          • kpac®
                          • Thanked: 184
                            • Yes
                            • Yes
                            • Yes
                          • Certifications: List
                          • Computer: Specs
                          • Experience: Expert
                          • OS: Windows 7
                          Re: css help
                          « Reply #20 on: September 10, 2010, 11:50:49 AM »
                          Also, now that you're using CSS to style your pages you should try and use XHTML wherever possible, i.e. small HTML tags (<html> and not <HTML>), don't use <body bgcolor=""> etc.. This will further help with cross-browser compatibility.