Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Using CSS

Using CSS

Scheduled Pinned Locked Moved Web Development
htmlcsswpfquestionannouncement
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andyg 101
    wrote on last edited by
    #1

    Hi there, I am developing a website and I am quite new to using CSS. I already have a lot of HTML to change/update that I think someone generated using word or frontpage. I want to apply styles to the standard heading tags h1 etc.. Can I do this but leave all the old etc tags in the html file or do I have to remove them(There are hundreds). I was trying to work out if there is an order of precedence for the tags, but I can't seem to work it out. sorry if this is a stupid question.

    N R T 3 Replies Last reply
    0
    • A andyg 101

      Hi there, I am developing a website and I am quite new to using CSS. I already have a lot of HTML to change/update that I think someone generated using word or frontpage. I want to apply styles to the standard heading tags h1 etc.. Can I do this but leave all the old etc tags in the html file or do I have to remove them(There are hundreds). I was trying to work out if there is an order of precedence for the tags, but I can't seem to work it out. sorry if this is a stupid question.

      N Offline
      N Offline
      Nino_1
      wrote on last edited by
      #2

      Andy, It sounds like you should start by doing a copy and paste of the HTML tags into notepad. Do this and save it as HTML, and see how your HTML behaves with your CSS Additions. Not knowing what your HTML code looks like I would try this and see how it turns out. I'm sure you'll get more good suggestions from the other members here, there is a lot of good folks here that have loads of experience with HTML, and programming. Tony

      1 Reply Last reply
      0
      • A andyg 101

        Hi there, I am developing a website and I am quite new to using CSS. I already have a lot of HTML to change/update that I think someone generated using word or frontpage. I want to apply styles to the standard heading tags h1 etc.. Can I do this but leave all the old etc tags in the html file or do I have to remove them(There are hundreds). I was trying to work out if there is an order of precedence for the tags, but I can't seem to work it out. sorry if this is a stupid question.

        R Offline
        R Offline
        Roger Wright
        wrote on last edited by
        #3

        I believe that if you have explicit styles coded into the HTML they will override to styles you specify in your css file - I don't know for sure because I try always to use one or the other method, but never both at the same time. If you have multiple css files linked into the page, the last one linked takes precedence over previous styles if there is any overlap in their contents. Probably the easiest way to learn it is to play with it. Create a simple test page with several elements in it but no styles specified. Give each section or element a class name. Then create a couple of css files with the same classes defined, but different styles associated with each, and link them into your html page HEAD section. View the results before and after changing the order in which they are linked in the page, then add some explicit style attributes in the HTML itself and see what effect that has. An hour or two of playing with it will probably answer a bunch of questions.

        "The Lion shall lie down with the Lamb;
        but the Lamb will not get much sleep..."
        Lazarus Long

        A 1 Reply Last reply
        0
        • R Roger Wright

          I believe that if you have explicit styles coded into the HTML they will override to styles you specify in your css file - I don't know for sure because I try always to use one or the other method, but never both at the same time. If you have multiple css files linked into the page, the last one linked takes precedence over previous styles if there is any overlap in their contents. Probably the easiest way to learn it is to play with it. Create a simple test page with several elements in it but no styles specified. Give each section or element a class name. Then create a couple of css files with the same classes defined, but different styles associated with each, and link them into your html page HEAD section. View the results before and after changing the order in which they are linked in the page, then add some explicit style attributes in the HTML itself and see what effect that has. An hour or two of playing with it will probably answer a bunch of questions.

          "The Lion shall lie down with the Lamb;
          but the Lamb will not get much sleep..."
          Lazarus Long

          A Offline
          A Offline
          andyg 101
          wrote on last edited by
          #4

          Hi again, I had a play around with it, and it looks like the style sheets get overridden by the html tags already present. i.e. if I do something like

          this is a title

          and the style sheet is set up for h1 without underline I still get underlined text. So I've taken to just commenting out the tags for the moment. One thing I would like to know though, is how is it possible to make pages that use CSS compatible with older browsers, if it isn't possible to have a set of default HTML tags in the document when no CSS support is available or have I completely missed the point? thanks andy

          R R 2 Replies Last reply
          0
          • A andyg 101

            Hi again, I had a play around with it, and it looks like the style sheets get overridden by the html tags already present. i.e. if I do something like

            this is a title

            and the style sheet is set up for h1 without underline I still get underlined text. So I've taken to just commenting out the tags for the moment. One thing I would like to know though, is how is it possible to make pages that use CSS compatible with older browsers, if it isn't possible to have a set of default HTML tags in the document when no CSS support is available or have I completely missed the point? thanks andy

            R Offline
            R Offline
            Roger Wright
            wrote on last edited by
            #5

            andyg.101 wrote: how is it possible to make pages that use CSS compatible with older browsers You can't. Older browsers don't support modern CSS. For them you have to encode the styles in your HTML and pray that they will work.

            "The Lion shall lie down with the Lamb;
            but the Lamb will not get much sleep..."
            Lazarus Long

            1 Reply Last reply
            0
            • A andyg 101

              Hi there, I am developing a website and I am quite new to using CSS. I already have a lot of HTML to change/update that I think someone generated using word or frontpage. I want to apply styles to the standard heading tags h1 etc.. Can I do this but leave all the old etc tags in the html file or do I have to remove them(There are hundreds). I was trying to work out if there is an order of precedence for the tags, but I can't seem to work it out. sorry if this is a stupid question.

              T Offline
              T Offline
              theJazzyBrain
              wrote on last edited by
              #6

              I had problems with HTML genereted by WORD or Front Page... Therefore I have created a class that cleans all the unwanted tags... I can send it to you if you want ... theJazzyBrain Wise is he who asks good questions, not he who gives good answers

              A 1 Reply Last reply
              0
              • A andyg 101

                Hi again, I had a play around with it, and it looks like the style sheets get overridden by the html tags already present. i.e. if I do something like

                this is a title

                and the style sheet is set up for h1 without underline I still get underlined text. So I've taken to just commenting out the tags for the moment. One thing I would like to know though, is how is it possible to make pages that use CSS compatible with older browsers, if it isn't possible to have a set of default HTML tags in the document when no CSS support is available or have I completely missed the point? thanks andy

                R Offline
                R Offline
                Rocky Moore
                wrote on last edited by
                #7

                andyg.101 wrote: how is it possible to make pages that use CSS compatible with older browsers You may not want to bother. Most people use modern browsers, only a hand full in comparison use browsers that do not understand basic CSS. If you wish to support those few, then you have two choices, don't use CSS or keep two versions of your site. Rocky Moore <><

                1 Reply Last reply
                0
                • T theJazzyBrain

                  I had problems with HTML genereted by WORD or Front Page... Therefore I have created a class that cleans all the unwanted tags... I can send it to you if you want ... theJazzyBrain Wise is he who asks good questions, not he who gives good answers

                  A Offline
                  A Offline
                  andyg 101
                  wrote on last edited by
                  #8

                  that would be cool, I'd like to see how you did it. thanks Andy

                  T 1 Reply Last reply
                  0
                  • A andyg 101

                    that would be cool, I'd like to see how you did it. thanks Andy

                    T Offline
                    T Offline
                    theJazzyBrain
                    wrote on last edited by
                    #9

                    if you give me an email address I can send it to you... Just to let you know that it a C# class. theJazzyBrain Wise is he who asks good questions, not he who gives good answers

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups