Skip navigation
Currently Being Moderated

div tag question

Apr 15, 2013 5:01 AM

Hello Dreamweavers.

 

Im trying to have 2 div tags one into another,and Im following a tutorial

but the im getting a different result from the instructors.

 

3.jpg

2.jpg

1.jpg

 

also here is the link of the vid tutorial,Id like to know if its a good way to go on about with this method,

 

http://www.youtube.com/watch?v=x23e4YRADQI

 

thank you.

 
Replies
  • Currently Being Moderated
    Apr 15, 2013 5:22 AM   in reply to inquestflash

    Since you are not including the CSS styles from the tutorial, this is an educated guess. Based on the images, the tutorial appears to be centering each div on the page and specifying both positioning and specific heights and widths for each div. Go back and compare the tutorial's stylesheed (indicated by line 6 of the tutorial code that starts <link href="style.css" . . . />) with your CSS code. In your version, you've only defined background color and height. Your code is giving you the correct result: each  divdisplaying the full width of your viewport with the "small" div being immediately shown after the "large" one.

     

    Chris

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2013 5:52 AM   in reply to inquestflash

    inquestflash wrote:

     

    also here is the link of the vid tutorial,Id like to know if its a good way to go on about with this method,

     

    http://www.youtube.com/watch?v=x23e4YRADQI

     

    thank you.

     

    Yes, the method the tutorial teaches is good. Setting height is not good BUT used in the tutorial it was just to show you the <divs> as rectangles with coloured backgrounds which makes the tutorial easier to follow.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2013 5:55 AM   in reply to osgood_

    As osgood says, the technique is fine (apart from giving a div a fixed height). The reason yours doesn't work is because you have not nested the second div inside the first one.

     

    You have this:

     

    <div id="big"></div>

    <div id="small"></div>

     

    It should be this:

     

    <div id="big">

        <div id="small"></div>

    </div>

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points