Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Creating a border using CSS

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #250331
    gkp1987
    Participant

    I really do not know anything at all about CSS. However, I have just started taking a free course to learn about it and HTML. I have been following the instructions and everything has been going fine until I tried to input a class using CSS and add a border – that’s where everything went wrong. There should be a border around ¨Here is some content for panel 1¨and ¨Here is some content for panel 2¨. It’s not showing up. Anyway, I have copied and pasted the code below for you to review the problem. Please do not use any complicated jargon as I am an absolute beginner!

    http://codepen.io/gkp1987/pen/wgeKMd/

    #251229
    Beverleyh
    Participant

    You’ll need to enclose multiple classes in straight quotes/apostrophes class="col-md-6 thin_border"

    #251270
    Codi
    Participant

    looking at your html you have no quotes on your class

    you have

    class=col-md-6 thin_border

    should be

    class=”col-md-6 thin_border”

    you need to add quotes to everything

    you have no quotes in style sheet links classes or ids

    anything with = needs to be in quotes.. example

    id=”something”
    class=”something”
    href=”link” etc…

    #251274
    Shikkediel
    Participant

    Actually, I learned today that unspaced attribute values can be left unquoted (thanks to B)…

    #251277
    Beverleyh
    Participant

    anything with = needs to be in quotes.. example

    id=”something”
    class=”something”
    href=”link” etc…

    Sorry but that isn’t entirely accurate. Doing as gkp1987 did, with the unquoted single class values, is perfectly valid too in inline HTML. As are unquoted href, src, id, etc., values. Attribute values only need to be surrounded in straight quotes, or straight apostrophes, if they contain space characters (as is the case with multiple classes) tabs, new lines etc., or other special characters like " ' = >or <.

    Check out the specs for more info https://html.spec.whatwg.org/multipage/introduction.html#intro-early-example

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.