SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 37 of 37
  1. #26
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post

    Code CSS:
    p img {display:block}
    mamma mia, I haven't learnt that yet.

    I was think in this way:


    <body>
    <p>
    Between this two tags you write the page content. Here you can write a paragraph like this one. Or you can insert here an image like the following that shows my favorite corner in my house.*
    </p>

    <p>
    ** * *<img src="myoffice.JPG" **alt="My favorite corner in my
    ** * * * * * * * * * * *house">
    </p>
    </body>

  2. #27
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    You could do that too:
    <p>text</p>
    <p><img></p>

    that also gives you a line break, since p's are blocks.

    There are always plenty of ways to do something, but the point is, how it looks should always be secondary to what it actually is (and you should be able to build correctly and still make it also look the way you want).

  3. #28
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    You could do that too:
    <p>text</p>
    <p><img></p>

    that also gives you a line break, since p's are blocks.
    Well, that gives you a paragraph break, which is semantically different from a line break. It usually also renders differently (a paragraph break is normally equal to two line breaks in height).

    (Sorry for nitpicking. )
    Birnam wood is come to Dunsinane

  4. #29
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Quote Originally Posted by Stomme poes View Post
    There are always plenty of ways to do something, but the point is, how it looks should always be secondary to what it actually is (and you should be able to build correctly and still make it also look the way you want).
    when you say ...how it looks.. you mean how it looks in the browser ?
    For me that would be primary than secondary, maybe I misunderstood your text.
    Tkyou.

  5. #30
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe how it looks is more important to you, but you need to understand the purposes of the various technologies.
    • HTML or XHTML marks up the content, indicating what things are (semantics) and how they are structured.
    • CSS indicates how that content should look in different output media.
    • JavaScript controls any dynamic or interactive behaviour of the content.

    Using the wrong tool for the wrong job makes a page more difficult – or even impossible – to use for some groups of users, and it also makes it more difficult to maintain.

    I believe that what Stomme poes is saying is that you shouldn't choose your XHTML elements based on how you want things to look. That's a job for CSS.
    Birnam wood is come to Dunsinane

  6. #31
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why the <img> tag does not have an ending tag like <p> and </P> ?

  7. #32
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because it can never have any content. It's a replaced element, where the tag is replaced by the specified image (or the alt text, if the image is unavailable or unsupported).

    You can't write markup like this to show text inside an image:
    Code:
    <img src="foo.jpg" alt="">
      I took this picture last summer!
    </img>
    Birnam wood is come to Dunsinane

  8. #33
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But is not the image the content by itself?

  9. #34
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, the image is the content, and it replaces the <img> tag.

    Start and end tags are only necessary when you need to mark up the beginning and end of a sequence of content. Since images cannot have any content (other than the image itself) there's no need for an end tag.
    Birnam wood is come to Dunsinane

  10. #35
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,077
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Yes, the image is the content, and it replaces the <img> tag.

    Start and end tags are only necessary when you need to mark up the beginning and end of a sequence of content. Since images cannot have any content (other than the image itself) there's no need for an end tag.
    The slash at the end is required for XHTML but not for HTML.

    <img alt="string" height=" { number | percentage } " src="uri" width=" { number | percentage } " />
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  11. #36
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does it exist </img>

  12. #37
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by julioa View Post
    Does it exist </img>
    In real XHTML, yes.
    In HTML and pretend-XHTML, no.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

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