Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7539641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:26:14+00:00 2026-05-30T07:26:14+00:00

I am new to Css. I have an HTML page. <body> <div id=viewer> <div

  • 0

I am new to Css. I have an HTML page.

 <body>

    <div id="viewer">

        <div id="flow">

            <img src="images/beatles.jpg">
            <img src="images/blink.jpg">
            <img src="images/doves.jpg">
            <img src="images/flash.jpg">
            <img src="images/floyd.jpg">
            <img src="images/jurassic.jpg">
            <img src="images/naked.jpg">
            <img src="images/prodigy.jpg">
            <img src="images/xx.jpg">
            <img src="images/zabiela.jpg">

        </div> <!--end of <div id="flow">  -->

        <ul>
            <li id="left">
                <a href="#" title="Move Left">Left</a>
            </li>

            <li id="right">
                <a href="#" title="Move Right">Right</a>
            </li>
        </ul>

    </div> <!--end of <div id="viewer">  -->

</body>

Each image is 200×200. Now i am confused with the css of it. Here i show it step by step

#viewer {
    width:700px;
    height:220px;
    padding:100px 0 30px;
    margin:auto;
    border:1px solid #000;
    position:relative;
}

You define width and height of main Div. Define padding, means each element that is place inside div will place 200px from top, no sapce from left and right, 30px space from bottom of div. Also i want to ask here we define position relative. Is it relative with respect to body or html?
We didn’t define the #flow div width and height. So it calculated by the padding. The #flow div width is same as the #viewer width, but place 30px below from top of #viewer div, it’s height is 190px, place 30px above from bottom. Please tell me if i am wrong.

#flow:after {
    content:"";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
}

Now we are defining content that we want to enter after the #flow div. We set it’s visibility hidden, means it is there, taking up the space but not showing. Is it? The thing that i want to ask here is this, that we are using clear:both here. What are we clearing here? we didn’t set any float property in the #viewer div?

Now comes the confusing part

#flow img {
    display:block;
    margin-left:-165px;
    position:relative;
    top:-15px;
    left:245px;
    float:left;
    background-color:#fff;
}

Now we are setting images, that are in the #flow Div. First thing that i notice which is confusing that if i set it’s top property to 1px. Then it align with respect to # flow div. Which is fine because it’s position is relative, and it is inside #flow div, so it is aligning with respect to #flow div.
But when i change it’s left property to 1px. Then it goes beyond the both divs(#viewer and #flow). Align itself somewhere between the mid of scree left corner and left of div. Why it is happening. If it’s position is relative, then it should remain inside the #flow div. This is my confusion.
Also images are shrink to accommodate inside the div. I think it’s because of the dov size. That each image is 200×200. Our #flow width is 700px only.

Another thing we set margin-left:-165px;. Right now images are arrange horizontally and also shrink to accommodate in the div. But if i change to margin-left:165px;. Then images are expand vertically and all images are shown. Images are not shrink. Also we set top:-15px;. When are we set values in negative?
It’s not an assignment or homework. I am just practicing and i want to know how things are working. Here are the remaining css

#viewer li {
    list-style-type:none;
    position:absolute;
    bottom:10px;
}

#left {
    left:20px;
}

#right {
    right:20px;
}

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:26:16+00:00Added an answer on May 30, 2026 at 7:26 am

    A good start to find out how the css works is to install firefox with firebug. In firebug, you can hover over elements to see their styling.

    Secondly, I would place the images in li tags for better organization.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pretty new at CSS but have been learning, doing my moms small
I have make a new dropdown navi in css . Chrome, firefox, safari is
I have installed a complete blank theme with no CSS in my new wordpress
How to add new css class or id and then write properties for html
Since i am new to CSS, i am not sure if the following page
i have a php page it have css script. i want to put menubar
I am kinda new to the whole html/css thing, but i managed to make
I have index.html page with start button when I click on start button button
i am i am new in CSS.. i have converted my psd file into
I have written a JavaScript-based print feature for a web page. It extracts HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.