/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Problem lining up multiple images and text lists

Using an external style sheet and template in DW CSS3, I am trying to create body content that will contain multiple images (stacked vertically) on the left side of the main content div, with each image followed by two sets of unordered text that appear side by side, both sets of text to the right of each image. I have tried assigning non-floating classes to all elements, but to no avail. I suspect my divs are not nested properly, and have tried to address that, but again with no success. I prefer fixed rather than floating elements, if at all possible, so that elements do not collapse when the page is resized. I would appreciate any assistance.

Here is a link to a screen shot of how I want it to appear:

[url]http://rich-gail.com/testcolors/testcolorspic.html[/url]

This is the link to the page I am trying to design:

[url]http://rich-gail.com/testcolors/testcolors1.html[/url]

Here is the styles.css code:

@charset “UTF-8”;
body {
margin: 0; /* it’s good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 100%;
background-color: #000099;
}
.twoColLiqLtHdr #container {
width: 80%; /*
this will create a container 80% of the browser width */
background: #FFFFFF;
margin: 0 auto; /*
the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /*
this overrides the text-align: center on the body element. */
}
.twoColLiqLtHdr #header {
background: #DDDDDD;
padding: 0 10px; /*
this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.twoColLiqLtHdr #header h1 {
margin: 0; /*
zeroing the margin of the last element in the #header div will avoid margin collapse – an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /*
using padding instead of margin will allow you to keep the element away from the edges of the div */
}

/* Tips for sidebar1:
1. since we are working in percentages, it’s best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the “.twoColLiqLtHdr #sidebar1 p” rule.
3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
*
/
.twoColLiqLtHdr #sidebar1 {
float: left;
width: 18%; /* since this element is floated, a width must be given */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 0; /* top and bottom padding create visual space within this div */
list-style-type: none;
}
.twoColLiqLtHdr #sidebar1 h3, .twoColLiqLtHdr #sidebar1 p {
margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
margin-right: 10px;
list-style-type: none;
}

/* Tips for mainContent:
1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div’s text to fill the #sidebar1 space when the content in #sidebar1 ends.
2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent “hasLayout.” This avoids several IE-specific bugs.
*
/
.twoColLiqLtHdr #mainContent {
margin-top: 0;
margin-right: 0px;
margin-bottom: 0;
margin-left: 20%;
}
.twoColLiqLtHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
}
.twoColLiqLtHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse – a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}

/* Miscellaneous classes for reuse */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}.header1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: large;
color: #FFFFFF;
background-color: #000099;
text-align: center;
width: 150px;
}
.header2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: large;
color: #000000;
text-align: left;
width: 150px;
margin-top: 20px;
margin-right: 0px;
margin-bottom: 10px;
margin-left: 0px;
}
.headerbase {
border-bottom-width: thick;
border-bottom-style: solid;
border-bottom-color: #000099;
width: 100%;
}
.list {
font-family: “Times New Roman”, Times, serif;
font-size: medium;
color: #000099;
margin: 10px;
padding: 10px;
border: medium solid #0066CC;
float: left;
width: 213px;
line-height: 25px;
}
.list_1 {
font-family: “Times New Roman”, Times, serif;
font-size: 14px;
float: left;
list-style-type: none;
color: #000000;
line-height: 27px;
text-align: left;
padding-top: 0px;
padding-right: 15px;
padding-bottom: 0px;
padding-left: 0px;
width: 190px;
margin: 0px;
left: auto;
}
.list_2 {
font-family: “Times New Roman”, Times, serif;
font-size: 14px;
float: left;
list-style-type: none;
color: #000000;
line-height: 27px;
text-align: left;
padding-top: 0px;
padding-right: 15px;
padding-bottom: 0px;
padding-left: 0px;
width: 190px;
margin: 0px;
display: block;
}
.imagefltlft {
text-align: left;
float: left;
padding-right: 10px;
padding-bottom: 10px;
margin-bottom: 20px;
}
.menuheader {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: x-large;
font-weight: bold;
color: #000099;
text-align: left;
}
.sectionheader {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: x-large;
font-weight: bold;
color: #000066;
text-align: left;
}

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@ray326Aug 08.2008 — .twoColLiqLtHdr #mainContent {

float:right;

width:80%;

}

And add clear:both to sectionheader.
Copy linkTweet thisAlerts:
@reo_forumsauthorAug 08.2008 — I tried that. Now the main content area is no longer positioned next to the sidebar.

http://www.rich-gail.com/testcolors/testcolors1.html
Copy linkTweet thisAlerts:
@ray326Aug 08.2008 — I tried that. Now the main content area is no longer positioned next to the sidebar.

http://www.rich-gail.com/testcolors/testcolors1.html[/QUOTE]

No you didn't. You've still got the margin in there.
Copy linkTweet thisAlerts:
@reo_forumsauthorAug 08.2008 — I only made the following changes that you previously suggested:

.twoColLiqLtHdr #mainContent {

float:right;

width:80%;

}

And add clear:both to sectionheader.

What [B]margin[/B] do you mean?
Copy linkTweet thisAlerts:
@reo_forumsauthorAug 08.2008 — I just realized that you meant for me to delete all the margins in the main content area. Now it works.

That third cup of coffee woke up a few more of my brain cells. :-)

Thank you.
×

Success!

Help @reo_forums spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...