Results 1 to 5 of 5

Thread: Issues with margin-left

  1. #1
    Join Date
    Aug 2007
    Location
    Brazil
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Issues with margin-left

    Hi everyone!
    Haven't seen you guys in a few months now..
    Today the problem seems to me a bit unreasonable, but here it goes:

    I'm working on my own website now, 1 column, 100% height, footer sticks to the bottom. Everything looks perfect, except for one small issue.
    Code:
    .part_text {
    	margin: 0 30px;
    	padding: 0;
    }
    This is supposed to style this part of my code:
    PHP Code:
    echo "<h2 class=\"title\">$title</h2>";
    echo 
    "<span class=\"part_text\">" substr($text,0,200) . "... <a href=\"articles.php?id=$id\">[more]</a></span><br />";
    echo 
    "<span class=\"date\">$date</span>"
    The problem is that the first line of the text appears as intended, with the 30px margins, but the following lines don't. They insist on sticking to the border.
    I'm sorry for not having an online version of it, I don't have a host yet. But I'm linking a shot of what's happening. If you need more details, let me know.


    Thanks for helping!

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Code:
    span.part_text {
         padding: 0 30px 0 30px;
    }
    or
    Code:
    span.part_text {
        padding-left: 30px;
        padding-right: 30px;
    }
    or
    Code:
    span.part_text {
         margin: 0 auto;
         width: 95%;
    }
    I know you were just trying to do it shorthand but I have had problems with that too. the only time shorthand has seemed to work for me is when you use it to center as in the last definition

  3. #3
    Join Date
    Aug 2007
    Location
    Brazil
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi!
    I tried your suggestions, but they didn't work as well. I tried the same structures using margin instead of padding, but nada.
    The centering part didn't work, the text sticks to the border.
    Still looking for a solution.

  4. #4
    Join Date
    Aug 2007
    Location
    Brazil
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi everyone.
    I was just wondering: could this problem be related to how the instructions are ordered?
    Thanks for any clarifications.

  5. #5
    Join Date
    Aug 2007
    Location
    Brazil
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Just to let you people know that I have the answer for the problem. The thing was that I was using span to show the text, which is an INLINE element. I should have used a BLOCK element, like p. I tried it and it works now.

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
  •