www.webdeveloper.com
Results 1 to 2 of 2

Thread: margin issue

  1. #1
    Join Date
    Jul 2012
    Posts
    12

    margin issue

    I'll start off by posting snippets where I'm having issues.

    HTML:

    PHP Code:
    <div id="content">
      <
    article class="main">
       <
    figure>
       </
    figure>
       <
    h1>TestHeader1</h1>
       <
    p>Dit is een testArticle.knzaokdnazodknazokdna
         zodnazodnazdonazdnazdnazodknazodnazodnazkdnonzando
           nazdondaokzdnkoazndkoazdnazokdnzakodnazokdnazodnazo
           dnazodnazdnzadklazndlazkndoizadazd
    ...</p>
      </
    article>
    </
    div
    CSS:
    PHP Code:
    #content {
        
    width:60&#37;;
        
    margin-left:auto;
        
    margin-right:auto;
        
    background-image:url('images/grassText01.png');
        
    border-radius:20px;
        
    box-shadow:1px 1px 5px #D8D8D8;
        
    min-height:500px;
    }

    .
    main {
        
    width:80%;
        
    margin-left:auto;
        
    margin-right:auto;
        
    min-height:125px;
        
    border:2px solid #C22026;

    The div is the main content window on the site, the articles could be something like news items. When I try to add a margin-top to the .main, expecting a margin between the top of the div and the top of the article, the entire div gets a margin.

    Does anyone know what could be causing this?

    Cheers.

    EDIT: Found a solution, used padding in the div. Although this solves my problem, I'm still questioned as to why the margin problem prompted. If any insight feel free to share. Cheers, tap
    Last edited by tapi0n; 08-12-2012 at 01:21 PM. Reason: Found solution

  2. #2
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    383
    i had no problem adding 'margin-top' to '.main'. worked perfectly. 'width:60&#37;;' should be 'width:60&#37;;'
    "Problems cannot be solved by the same level of thinking that created them.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles