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 1107777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:59:06+00:00 2026-05-17T01:59:06+00:00

I am a iPhone developer stuck with some basic CSS properties ;) I want

  • 0

I am a iPhone developer stuck with some basic CSS properties 😉
I want to show something like this:
alt text

This is what I have:

<div class="cell">
    <div class="cell_3x3_top">
        <div class="cell_3x3_type rounded_left">type</div> <!--UPDATED:2010/09/29-->
        <div class="cell_3x3_title rounded_right">title</div><!--UPDATED:2010/09/29-->
    </div>
    <div class="cell_3x3_content rounded_left rounded_right">content</div><!--UPDATED:2010/09/29-->
</div>

and the css:

div.cell_3x3_top{
    height:20%;
    margin: 0 0 0 0;
    padding: 0 0 0 0;
    border: none;
    margin-bottom: 1px; /*to compensate space between top and content*/
    text-align: center;
    vertical-align: middle;


}
div.cell_3x3_type{
    width:20%;
    float:left;
    background-color: inherit;
    margin-right: -2px; /*UPDATED:2010/09/29*/
}
div.cell_3x3_title{
    width:80%;
    float:left;
    background-color: inherit;
    margin: 0 0 0 0;  /* maybe not neccesary*/
    padding: 0 0 0 0; /*maybe not neccesary*/
    margin-left: -1px; /*UPDATED:2010/09/29 */

}
div.cell_3x3_content{
    height:80%;
    background-color: inherit;
}

But when I render my content with above code title div seems to be too large and it appears underneath type div, Why is this?
type div is 20% width, title is 80% width so it should be 100% exactly. Is any margin or other metric I am forgetting here?
I have tried to move title div to the left using margin but is still buggy. I wonder what is the correct way of getting something like the picture?
(Not exactly because if you look closer title div is a little bit shorter than it should be. See that its right border is not aligned with content div.)

Thanks in advance.

EDIT: 2010/09/28

This is actually what I want to achieve:
alt text

and this is what I have:
alt text

Above code (updated a little bit) would work if I wouldn’t have bordered divs. Since border width is 1px what I need is to set type div width to 20%-2px (left border + right border = 2px) and title div to 80%-2px

.rounded_left{
    border-top-left-radius: 4px 4px;
    border-bottom-left-radius: 4px 4px;

    border-color:gray;
    border-width: 1px;
    border-style:solid;
}

(.rounded_right is similar)

This is not related to clear:both property I believe. I tried and didn’t had any effect since my content div was good form the beginning.

In short: How can I make a div including its border to be let’s say exactly 20% width?

Ignacio

ANSWER:

I realized that a wrapper div around type and title respectively solves the problem. So my answer is kind of like this:

<td class="cell">
<div class="cell_3x3_top bordered">
<div class="cell_3x3_type_container"><div class="cell_3x3_type rounded_left full_height">6</div></div>
<div class="cell_3x3_title_container"><div class="cell_3x3_title rounded_right full_height">title</div></div>                                                               </div>
<div class="cell_3x3_content rounded_left rounded_right">content</div>
</td>

I set 20% and 80% in the containers and the borders in the inner div.

  • 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-17T01:59:06+00:00Added an answer on May 17, 2026 at 1:59 am

    You are missing a clearing div. The floating elements do not expand the .cell_3x3_type div as you would expect. Try this instead:

    <div class="cell">
        <div class="cell_3x3_top">
            <div class="cell_3x3_type">type</div>
            <div class="cell_3x3_title">title</div>
            <div class="cell_3x3_clear"></div>
        </div>
        <div class="cell_3x3_content">content</div>
    </div>
    

    CSS:

    div.cell_3x3_clear  {
      clear: both;
    }
    

    The rest remains the same.

    EDIT:
    A small explanation of what the clear property does: consider a container div that contains only floated elements, like this (using inline CSS for clarity):

    <div id="container" style="border: 1px solid green;">
      <div style="float: left; height: 30px; width: 30px; border: 1px solid red;"></div>
      <div style="float: left; height: 20px; width: 20px; border: 1px solid blue;"></div>
    </div>
    


    (source: fii.cz)

    The height of the container div is 0 because the floating elements are taken out of the document flow and do not affect the height of their container anymore. The clear: both property on an element "clears" all floats, i.e. makes sure that the element is placed below all floating elements that precede it:

    <div style="float: left; height: 30px; width: 30px; border: 1px solid red;"></div>
    <div style="float: left; height: 20px; width: 20px; border: 1px solid blue;"></div>
    <div style="clear: both; height: 10px; width: 50px; border: 1px solid black;">Cleared</div>
    


    (source: fii.cz)

    If you combine the two above examples, you can force the container div to have its height equal to the height of the highest floating element in it:

    <div id="container" style="border: 2px solid green;">
      <div style="float: left; height: 30px; width: 30px; border: 1px solid red;"></div>
      <div style="float: left; height: 20px; width: 20px; border: 1px solid blue;"></div>
      <div style="clear: both; height: 0px; border: 1px solid black;"></div>
    </div>
    


    (source: fii.cz)

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

Sidebar

Related Questions

I m stuck with this error: Code Sign error: Certificate identity 'iPhone Developer: My
I'm an iphone developer, but this question is about geometry. I have a simple
I am new to iPhone developer, I want to implement different Animations on button
I am new to iPhone Developer. i want to do navigate to new page
I am new to iPhone developer, On click of button, i want to navigate
I am new to iPhone developer, I have 4 page in my Application, my
I am new to iPhone Developer, I want to detect touch in my webview
First some background: The company I work for have decided to create an iPhone
I am an iPhone developer. I create many mobile applications. Some of them need
I don't know about PHP scripts. Am a iPhone developer. I want to enable

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.