Image side by side problem

Hey everyone I’m trying to put an image side by side in css but I’m having a little trouble.

I tried searching online but the methods they used didn’t work when I tried them

here’s how I want the images to look like side by side

Here’s how it looks with my coding :frowning:

Now the left image which is leftbox in my dv id
is a background image with a text div
right box is obviously the right box and that one is an img src on
the xhtml, I read somewhere you have to do it this way but it didn’t work

Hopefully you could help me out

here’s my coding
XHTML


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="Style2.css"/>


</head>

<body>
<div id="container">
<div id="header">
<ul id="navbar">
  <li><a href="home.html" id="home">Home</a></li>
  <li><a href="manufacturing.html" id="manufacturing">Manufacturing</a></li>
  <li><a href="services.html" id="services">Services</a></li>
  <li><a href="aboutus.html" id="aboutus">AboutUs</a></li>
  <li><a href="contactus.html" id="contactus">ContactUs</a></li>
  <li><a href="requestforquote.html" id="requestforquote">RequestforQuote</a></li>
  </ul>
  </div>
</div>
<div id="maincenter">
<div id="maincenter_content">

<p align="left" style="text-indent: 2em;"><strong>    &ldquo; With  more than 35 years of experience, <br/>
  CUSTOM PRODUCT DEVELOPMENT CORPORATION<br/> provides innovative/low cost engineered mechanical  components and Turn-Key Assembly solutions.  Our technical design  expertise, coupled with creative manufacturing and supply chain  control, ensures that our customers receive the best possible service  available in today's competitive industry.&rdquo;</strong></p>

</div>
</div>
<div id="leftbox">
<div id="leftbox_content">
<p align="left">
</p>
<p align="left"><strong>We  pride ourselves on Outstanding Customer Service and Product Quality.   Whether you are a current customer, or a potentially new customer, we  take a genuine interest in your product requirements.  Customer  loyalty is a priority at Custom Product Development Corporation.</strong></p>

</div>
</div>
<div id="rightbox">
<div align="center"><a href="#"><img src="images/Rightbodyimg.jpg" alt="This is an image" width="280" height="261" border="0" /></a> </div>

</div>
</body>
</html>


CSS


*{
	padding:0;
	margin:0;
}

body {
	font-family:Calibri;	
	padding:0;
	margin:0;
	background-color:#000000;
}

#container {
	width:897px;
	padding:0;
	margin:auto;
}

#header{
	background-repeat:no-repeat;
	background-image:url(Banner.png);	
	height: 158px;
	width: 897px;
	margin-top: 20px;
	clear: both;
}

#navbar {
	margin: 0px;
	padding: 0px;
	margin-left: 5px;
		
	list-style: none;
}

#navbar a {
	text-decoration: none;
	display:block;
	float:left;
	text-indent: -5000px;
}

#navbar li{
float: left;
}

#navbar #home{	
	background-image:url(Home.png);
	background-repeat: no-repeat;
	background-position: 0 0;
	margin-top: 180px;
	width: 120px;
	height: 58px;
}

#navbar #home:hover{
	background-position: 0 -58px;
}

#navbar #manufacturing{	
	background-image:url(Manufacturing.png);		
	background-repeat:no-repeat;
	background-position: 0 0;
	margin-top:180px;
	margin-left:1px;	
	width: 154px;
	height: 58px;
}
#navbar #manufacturing:hover{
	background-position: 0 -58px;
}

#navbar #services{	
	background-image:url(Services.png);			
	background-repeat:no-repeat;
	background-position: 0 0;
	width: 121px;
	height:58px;
	margin-left: 0px;
	margin-top: 180px;
		
	
}

#navbar #services:hover{
	background-position: 0 -58px;
}

#navbar #aboutus{	
	background-image:url(About-Us.png);			
	background-repeat:no-repeat;
	background-position: 0 0;
	width: 129px;
	height:58px;
	margin-left: 0px;
	margin-top: 180px;
		
	
}

#navbar #aboutus:hover{
	background-position: 0 -58px;
}

#navbar #contactus{
	background-image:url(ContactUs.png);					
	background-repeat:no-repeat;
	background-position: 0 0;
	width: 132px;
	height:58px;
	margin-left: 0px;
	margin-top: 180px;
		
	
}

#navbar #contactus:hover{
	background-position: 0 -58px;
}

#navbar #requestforquote{	
	background-image:url(RequestForQuote.png);					
	background-repeat:no-repeat;
	background-position: 0 0;
	width: 229px;
	height:58px;
	margin-left: 0px;
	margin-top: 180px;
		
	
}

#navbar #requestforquote:hover{
	background-position: 0 -58px;
}

#maincenter{
	background-repeat:no-repeat;
	background-image:url(Body1.jpg);
	height: 367px;
	width: 890px;
	clear: both;
	display: block;
	margin-left: auto;   
	margin-right: auto;
}
#maincenter_content {
	clear: both;
	float: right;
	width: 435px;
	margin-top: 130px;	

}

#maincenter_content p {
	font-family:Calibri;	
	font-size: 20px;
	line-height: 20px;
	color:#FFF;

}

#leftbox{
	background-repeat:no-repeat;
	background-image:url(images/Leftimg.jpg);
	height: 261px;
	width: 517px;
	clear: both;
	display: block;
	margin-left: 382px;
	margin-top: 5px;   
	
}

#leftbox_content {
	clear: both;
	float: right;
	width: 350px;
	margin-top: 90px;	

}

#leftbox_content p {
	font-family:Calibri;	
	font-size: 20px;
	line-height: 18px;
	color:#FFF;

}
	
#rightbox{
	

}

I took off all the margins in right box because it wasn’t working
just if your curious why it’s blank

Got it to work
here’s the code


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="Style2.css"/>


</head>

<body>
<div id="container">
<div id="header">
<ul id="navbar">
  <li><a href="home.html" id="home">Home</a></li>
  <li><a href="manufacturing.html" id="manufacturing">Manufacturing</a></li>
  <li><a href="services.html" id="services">Services</a></li>
  <li><a href="aboutus.html" id="aboutus">AboutUs</a></li>
  <li><a href="contactus.html" id="contactus">ContactUs</a></li>
  <li><a href="requestforquote.html" id="requestforquote">RequestforQuote</a></li>
  </ul>
  </div>
</div>
<div id="maincenter">
<div id="maincenter_content">

<p align="left" style="text-indent: 2em;"><strong>    &ldquo; With  more than 35 years of experience, <br/>
  CUSTOM PRODUCT DEVELOPMENT CORPORATION<br/> provides innovative/low cost engineered mechanical  components and Turn-Key Assembly solutions.  Our technical design  expertise, coupled with creative manufacturing and supply chain  control, ensures that our customers receive the best possible service  available in today's competitive industry.&rdquo;</strong></p>

</div>
</div>
<div id="leftbox">
<div id="leftbox_content">
<p align="left">
</p>
<p align="left"><strong>We  pride ourselves on Outstanding Customer Service and Product Quality.   Whether you are a current customer, or a potentially new customer, we  take a genuine interest in your product requirements.  Customer  loyalty is a priority at Custom Product Development Corporation.</strong></p>

</div>
</div>
<div id="rightbox">
    <div align="center"><a href="#"><img src="images/Rightbodyimg.jpg" alt="This is an image" width="280" height="261" border="0" /></a> </div>
  </div>

</body>
</html>


CSS


*{
	padding:0;
	margin:0;
}

body {
	font-family:Calibri;	
	padding:0;
	margin:0;
	background-color:#000000;
}

#container {
	width:897px;
	padding:0;
	margin:auto;
}

#header{
	background-repeat:no-repeat;
	background-image:url(Banner.png);	
	height: 158px;
	width: 897px;
	margin-top: 20px;
	clear: both;
}

#navbar {
	margin: 0px;
	padding: 0px;
	margin-left: 5px;
		
	list-style: none;
}

#navbar a {
	text-decoration: none;
	display:block;
	float:left;
	text-indent: -5000px;
}

#navbar li{
float: left;
}

#navbar #home{	
	background-image:url(Home.png);
	background-repeat: no-repeat;
	background-position: 0 0;
	margin-top: 180px;
	width: 120px;
	height: 58px;
}

#navbar #home:hover{
	background-position: 0 -58px;
}

#navbar #manufacturing{	
	background-image:url(Manufacturing.png);		
	background-repeat:no-repeat;
	background-position: 0 0;
	margin-top:180px;
	margin-left:1px;	
	width: 154px;
	height: 58px;
}
#navbar #manufacturing:hover{
	background-position: 0 -58px;
}

#navbar #services{	
	background-image:url(Services.png);			
	background-repeat:no-repeat;
	background-position: 0 0;
	width: 121px;
	height:58px;
	margin-left: 0px;
	margin-top: 180px;
		
	
}

#navbar #services:hover{
	background-position: 0 -58px;
}

#navbar #aboutus{	
	background-image:url(About-Us.png);			
	background-repeat:no-repeat;
	background-position: 0 0;
	width: 129px;
	height:58px;
	margin-left: 0px;
	margin-top: 180px;
		
	
}

#navbar #aboutus:hover{
	background-position: 0 -58px;
}

#navbar #contactus{
	background-image:url(ContactUs.png);					
	background-repeat:no-repeat;
	background-position: 0 0;
	width: 132px;
	height:58px;
	margin-left: 0px;
	margin-top: 180px;
		
	
}

#navbar #contactus:hover{
	background-position: 0 -58px;
}

#navbar #requestforquote{	
	background-image:url(RequestForQuote.png);					
	background-repeat:no-repeat;
	background-position: 0 0;
	width: 229px;
	height:58px;
	margin-left: 0px;
	margin-top: 180px;
		
	
}

#navbar #requestforquote:hover{
	background-position: 0 -58px;
}

#maincenter{
	background-repeat:no-repeat;
	background-image:url(Body1.jpg);
	height: 367px;
	width: 890px;
	clear: both;
	display: block;
	margin-left: auto;   
	margin-right: auto;
}
#maincenter_content {
	clear: both;
	float: right;
	width: 435px;
	margin-top: 130px;	

}

#maincenter_content p {
	font-family:Calibri;	
	font-size: 20px;
	line-height: 20px;
	color:#FFF;

}

#leftbox{
	background-repeat:no-repeat;
	background-image:url(images/Leftimg.jpg);
	height: 261px;
	width: 517px;
	margin-left: 387px;		
	float:left;
}

#leftbox_content {
	clear: both;
	float: right;
	width: 350px;
	margin-top: 90px;	

}

#leftbox_content p {
	font-family:Calibri;	
	font-size: 20px;
	line-height: 18px;
	color:#FFF;

}
	
#rightbox{
	float:left;
	padding-left: 75px;
		
}

Hi,
When looking at the first code you posted it looks like you are trying to use clear:both; on just about everything. It only needs to be used when you actually want to clear a float above the current element.

I also notice a lot of redundant code and longhand css that can be cleaned up. :slight_smile:

I was put this together for you, I used some BG colors to show what is going on since I didn’t have your images. It would be in your best interest to get rid of that transitional DTD your using, all it’s doing is allowing you to use deprecated code which has no place in new pages. Use a strict doctype.

I generally don’t use html comments unless absolutely necessary but I placed a couple of them in here so you could see what was going on. I also nested everything in your container div.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>

<style type="text/css">
body {
    margin: 0;
    padding: 0;
    font: 100%/1.3 calibri, arial, helvetica, sans-serif;
    background: #000;
}
a img {border:0 none}

#container {
    width: 897px;
    margin: 0 auto;
    padding:20px 0;
}
#header {
    height: 158px;
    background: url(Banner.png) no-repeat #0F0;
    overflow:hidden;/*uncollapse child margins*/
}

/*===== Begin Nav Bar ======*/
#navbar {
    margin: 20px 0 0;
    padding: 0px;
    list-style: none;
    overflow:hidden;/*contain floats*/
    background:yellow;
}
#navbar li {
    float: left;
}
#navbar a {
    float: left;
    height: 58px;/*group common rules*/
    text-decoration: none;
    /*text-indent: -5000px;*/
}
#navbar #home {
    width: 120px;
    background: url(Home.png) no-repeat 0 0;
}
#navbar #manufacturing {
    width: 154px;
    margin-left: 1px;
    background: url(Manufacturing.png) no-repeat 0 0;
}
#navbar #services {
    width: 121px;
    background: url(Services.png) no-repeat 0 0;
}
#navbar #aboutus {
    width: 129px;
    background: url(About-Us.png) no-repeat 0 0;
}
#navbar #contactus {
    width: 132px;
    background: url(ContactUs.png) no-repeat 0 0;
}
#navbar #requestforquote {
    width: 229px;
    background: url(RequestForQuote.png) no-repeat 0 0;
}
#navbar #home:hover,
#navbar #manufacturing:hover,
#navbar #services:hover,
#navbar #aboutus:hover,
#navbar #contactus:hover,
#navbar #requestforquote:hover {
    background-position: 0 -58px;
    background-color: red;
}

/*===== Begin Content Divs ======*/
#main-box {
    width: 890px;
    min-height: 367px;
    margin: 20px auto 0;
    background:blue url(Body1.jpg) no-repeat;
    overflow:hidden;/*contain floats*/
}
    #main-inner {
        float: right;
        width: 435px;
        margin-top:130px;
    }
    #main-inner p {
        margin: 0;
        font: 20px/20px calibri,arial;
        color: #FFF;
        text-indent: 2em;
    }

/*===== Begin Left and Right Divs ======*/
#sub-box {
    width:100%;/*IE haslayout/contain floats*/
    overflow:hidden;/*contain floats*/
    margin-top:20px;
    padding: 5px 0 0;
    background:#CCC;
}
#left-box {
    float: left;
    height: 261px;
    width: 517px;
    background:red url(images/Leftimg.jpg) no-repeat;
}
    #left-inner {
        float: right;
        width: 350px;
        margin-top: 90px;
        background:#000;
    }
    #left-inner p {
        margin: 0;
        font: 20px/20px calibri,arial;
        color: #FFF;
    }

#right-box {
    float:right;
    width:370px;
    background:green;
}
    #right-inner {
        float: right;
        background:#000;
    }
    #right-inner img {
        display:block;
        width:280px;
        height:261px;
        background:orange;
    }

#footer {
    width:100%;
    margin-top:20px;
    background:yellow;
    text-align:center;
    overflow:hidden;
}
</style>

</head>
<body>

<div id="container">
    
    <div id="header">
        <h1>Header Here</h1>
    </div>
    
    <ul id="navbar">
        <li><a href="home.html" id="home">Home</a></li>
        <li><a href="manufacturing.html" id="manufacturing">Manufacturing</a></li>
        <li><a href="services.html" id="services">Services</a></li>
        <li><a href="aboutus.html" id="aboutus">AboutUs</a></li>
        <li><a href="contactus.html" id="contactus">ContactUs</a></li>
        <li><a href="requestforquote.html" id="requestforquote">RequestforQuote</a></li>
    </ul>
    
    <div id="main-box">
        <div id="main-inner">
            <p><strong>&ldquo; With  more than 35 years of experience,<br>
            CUSTOM PRODUCT DEVELOPMENT CORPORATION<br>
            provides innovative/low cost engineered mechanical components and Turn-Key Assembly solutions. 
            Our technical design expertise, coupled with creative manufacturing and supply chain control, 
            ensures that our customers receive the best possible service available in today's competitive 
            industry.&rdquo;</strong></p>
        </div>
    </div>

    <div id="sub-box">    
        <div id="left-box">
            <div id="left-inner">
                <p><strong>We pride ourselves on Outstanding Customer Service and Product Quality. Whether you are 
                a current customer, or a potentially new customer, we take a genuine interest in your product 
                requirements. Customer loyalty is a priority at Custom Product Development Corporation.</strong></p>
            </div>
        </div>
        
        <div id="right-box">
            <div id="right-inner">
                <a href="#"><img src="images/Rightbodyimg.jpg" alt="This is an image"></a>
            </div>
        </div>
    </div><!-- end sub-box-->
    
    <div id="footer">
        <p>Footer Stuff Here</p>
    </div>

</div><!-- end container-->

</body>
</html>

Wow thank you show much
your awesome!!

Quick question however
I see that you included
my right image in HTML 4.01
and in css as the color orange

which one do I keep or do I keep both images in both locations?
Also when I try to validate my code
my <link rel=“stylesheet” type=“text/css” href=“Style3.css”/> comes up as a error
how do I link my css then?

Quick question however
I see that you included
my right image in HTML 4.01
and in css as the color orange

which one do I keep or do I keep both images in both locations?

Hi,
I just did that because I did not have your actual image. I use FF as my default browser and it will not display the image dimensions without the image. That is why I set it as display:block with a BG color in the css. You can remove those temporary img rules. Set the img dimensions back in the html though so browsers can account for the space when the page is loading.

Also when I try to validate my code
my <link rel=“stylesheet” type=“text/css” href=“Style3.css”/> comes up as a error
how do I link my css then?
It’s probably the closing forward slash above (in red)
HTML 4.01 does not require images, meta tags, or links etc. to be closed.

If it’s not critical to your design I would change the #container width to 890px from 897px.
890px is what you had the #main-box width set at when using auto margins.

If you move it to the #container you can eliminate auto margins on the #main-box


#container {
    width:[B] 890px;[/B]  /*897px*/
    margin: 0 auto;
    padding:20px 0;
}

#main-box {
    width:[B]100%;[/B] /*haslayout IE6 when using min-height /*890px*/
    min-height: 367px;
    margin: [B]20px 0 0;[/B]  /*20px auto 0*/
    background:blue url(Body1.jpg) no-repeat;
    overflow:hidden;/*contain floats*/
}

Thanks rayzur

now for the hardest part I have to add these 6 images on top of an image and they have to be rollover

Border Image

6 images inside of border image

How might I accomplish this?
do you happen to know a website that could show me or if it is really simple to make maybe give me some advise?
Any information will be greatly appreciated

I have to add these 6 images on top of an image and they have to be rollover
I would just set them up as list items in a UL and apply them as background images. Similar to what you have done on your navbar, that is use an ID on each anchor and hook the specific images there. That will allow you to control the rollover with a:hover

If you want them centered and spaced evenly then you can use inline-block on the list items.

Something like this but set them up as BG images.

what do I do about the border image
that whole entire square is an image
so how would I be able to the put the nav buttons over it
if it’s set as a background img as well?
I know absolute positioning is a no no

what do I do about the border image
that whole entire square is an image

Set that img as the BG for the UL and give the UL the same dimensions as the BG image.

It’s a presentational image so it should be a background, not an html image.

I get the concept but I don’t know how to apply it
have any examples?

What im thinking is this


<ul id="machining">
        <li><a href="precision1.html" id="precision1">Precision1</a></li>
        <li><a href="precision2.html" id="precision2">Precision2</a></li>
        <li><a href="precision3.html" id="precision3">Precision3</a></li>
        <li><a href="precision4.html" id="precision4">Precision4</a></li>
        <li><a href="precision5.html" id="precision5">Precision5</a></li>
        <li><a href="precision6.html" id="precision6">Precision6</a></li>
    </ul>

CSS


#machining {
    margin: 20px 0 0;
    padding: 0px;
    list-style: none;
    overflow:hidden;/*contain floats*/
	background:(border.jpg);
	width:898;
	height401:
	
   }

then do the rest like I did for the nav bar?

have any examples?

Look back at the example I gave in post#7 and view the page source for the css.

I was thinking more along the lines of using inline-block for the LI instead of floats. That will allow you to space them out with text-align:center on the UL.

Then you can set margins on the LI for spacing between them.

I’m on my way out the door right now but I will check back to see how you come along with it. Someone else might step in and pick up where I left of though if you have any problems. :wink:

Rayzur thank you so much for helping me go through this,
i’m new at this stuff and it’s nice that you took the time to help me.
Again thank you

So I got really close but there’s a gap in the middle between the 3 images

Here’s how it looks

Here’s how it’s supposed to look

Here’s my coding
HTML


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="Style4.css">
<style type="text/css">
</style>
 
</head>
<body>
 
<div id="container">
    
    <div id="header">
        
    </div>
    
    <ul id="navbar">
        <li><a href="home.html" id="home">Home</a></li>
        <li><a href="manufacturing.html" id="manufacturing">Manufacturing</a></li>
        <li><a href="services.html" id="services">Services</a></li>
        <li><a href="aboutus.html" id="aboutus">AboutUs</a></li>
        <li><a href="contactus.html" id="contactus">ContactUs</a></li>
        <li><a href="requestforquote.html" id="requestforquote">RequestforQuote</a></li>
    </ul>
    
    <div id="main-box">
        <div id="main-inner">
            <p><strong>&ldquo; With  more than 35 years of experience,<br>
            CUSTOM PRODUCT DEVELOPMENT CORPORATION<br>
            provides innovative/low cost engineered mechanical components and Turn-Key Assembly solutions. 
            Our technical design expertise, coupled with creative manufacturing and supply chain control, 
            ensures that our customers receive the best possible service available in today's competitive 
            industry.&rdquo;</strong></p>
        </div>
    </div>
 
    <div id="sub-box">    
        <div id="left-box">
            <div id="left-inner">
                <p><strong>We pride ourselves on Outstanding Customer Service and Product Quality. Whether you are 
                a current customer, or a potentially new customer, we take a genuine interest in your product 
                requirements. Customer loyalty is a priority at Custom Product Development Corporation.</strong></p>
            </div>
        </div>
        
        <div id="right-box">
            <div id="right-inner">
                <a href="#"><img src="images/Rightbodyimg.jpg" alt="This is an image"></a>
            </div>
        </div>
    </div><!-- end sub-box-->
    
   <ul id="border">
        <li><a href="precisionmachining.html" id="precisionmachining">Precisionmachining</a></li>
        <li><a href="precisionsheetmetal.html" id="precisionsheetmetal">Precisionsheetmetal</a></li>
        <li><a href="gasket.html" id="gasket">Gasket</a></li>
        <li><a href="assembly.html" id="assembly">Assembly</a></li>
        <li><a href="engineering.html" id="engineering">Engineering</a></li>
        <li><a href="otherservices.html" id="otherservices">Otherservices</a></li>
    </ul>
    
 
</div><!-- end container-->
 
</body>
</html>

CSS


body {
    margin: 0;
    padding: 0;
    font: 100%/1.3 calibri, arial, helvetica, sans-serif;
    background: #000;
}
a img {border:0 none}
 
#container {
    width: 897px;
    margin: 0 auto;
    padding:20px 0;
}
#header {
    height: 158px;
    background: url(Banner.png) no-repeat #0F0;
    overflow:hidden;/*uncollapse child margins*/
}
 
/*===== Begin Nav Bar ======*/
#navbar {
    margin: 20px 0 0;
    padding: 0px;
    list-style: none;
    overflow:hidden;/*contain floats*/
	background:#000;
   }
#navbar li {
    float: left;
}
#navbar a {
    float: left;
    height: 58px;/*group common rules*/
    text-decoration: none;
	text-indent: -5000px;
    /*text-indent: -5000px;*/
}
#navbar #home {
    width: 120px;
    background: url(Home.png) no-repeat 0 0;
}
#navbar #manufacturing {
    width: 154px;
    margin-left: 1px;
    background: url(Manufacturing.png) no-repeat 0 0;
}
#navbar #services {
    width: 121px;
    background: url(Services.png) no-repeat 0 0;
}
#navbar #aboutus {
    width: 129px;
    background: url(About-Us.png) no-repeat 0 0;
}
#navbar #contactus {
    width: 132px;
    background: url(ContactUs.png) no-repeat 0 0;
}
#navbar #requestforquote {
    width: 229px;
    background: url(RequestForQuote.png) no-repeat 0 0;
}
#navbar #home:hover,
#navbar #manufacturing:hover,
#navbar #services:hover,
#navbar #aboutus:hover,
#navbar #contactus:hover,
#navbar #requestforquote:hover {
    background-position: 0 -58px;
   
}
 
/*===== Begin Content Divs ======*/
#main-box {
    width: 890px;
    min-height: 367px;
    margin: auto 0;
    background:blue url(Body1.jpg) no-repeat;
    overflow:hidden;/*contain floats*/
}
    #main-inner {
        float: right;
        width: 435px;
        margin-top:130px;
    }
    #main-inner p {
        margin: 0;
        font: 20px/20px calibri,arial;
        color: #FFF;
        text-indent: 2em;
    }
 
/*===== Begin Left and Right Divs ======*/
#sub-box {
    width:100%;/*IE haslayout/contain floats*/
    overflow:hidden;/*contain floats*/
    margin-top:10px;
    padding: 5px 0 0;
	background:#000;    
}
#left-box {
    float: left;
    height: 261px;
    width: 517px;
    background:url(images/Leftimg.jpg) no-repeat;
}
    #left-inner {
        float: right;
        width: 350px;
        margin-top: 88px;
        
    }
    #left-inner p {
        margin: 0;
        font: 20px/20px calibri,arial;
        color: #FFF;
    }
 
#right-box {
    float:right;
    width:370px;
   
}
    #right-inner {
        float: right;
        background:#000;
    }
    #right-inner img {
        display:block;
        width:280px;
        height:261px;
        
    }
 
#border {
    display:table;/*Webkit node fix*/
    width:896px;	
    margin:0 auto;
    padding:5px;
    list-style:none;
    word-spacing:-.25em;/*hide white-space nodes*/
    text-align:center;
	background:url(Borderbottom.png);	

   }
#border li {
    display:-moz-inline-box;/* FF2 & under */
    display:inline-block;/* for modern browsers */
    vertical-align:top;
    word-spacing:normal;
	text-align:center;
	margin-top: 45px;	
	margin-left: 4px;
	margin-right: 8px;
      
    font-weight:bold;

}
#border a {
    float: left;
    height: 143px;/*group common rules*/
    text-decoration: none;
	text-indent: -5000px;
    /*text-indent: -5000px;*/
}
#border #precisionmachining {
    width: 248px;
	background:url(Precision-Maching.jpg) no-repeat 0 0;
    
}
#border #precisionsheetmetal {
    width: 248px;
    margin-left: 1px;
	background: url(Precision-Sheet-metal.jpg) no-repeat 0 0;
}
#border #gasket {
    width: 248px;
	background: url(Gasket-die-cutting-.jpg) no-repeat 0 0;
}
#border #assembly {
	background:url(Assembly-&-turn-key.jpg) no-repeat 0 0;
    width: 248px;    
}
#border #engineering {
	background:url(Engineering.jpg) no-repeat 0 0; 	
	 width: 248px;  
}
#border #otherservices {
    width: 248px;
	background:url(Quality-Assurance.jpg) no-repeat 0 0;    
}
#border #precisionmachining:hover,
#border #precisionsheetmetal:hover,
#border #gasket:hover,
#border #assembly:hover,
#border #engineering:hover,
#border #otherservices:hover {
    background-position: 0 -143px;

Ive tried margin bottom
I tried changing the vertical to middle I tried many things but nothing

I have no clue

So I got really close but there’s a gap in the middle between the 3 images
Hi,

If there is any way you can get your page online and post a link that would be best. That way I can access your images, I am having to use BG colors so I can see what is going on.

Are you talking about the vertical margins between the list items?
If so that’s because you set a 45px top margin on them on your #border li rules.

One thing to remember about inline-block is that their vertical margins do not collapse, they behave similar to floats in that regard.

I also noticed that the side paddings you set on the #border (UL) exceed the container width when added to the #border width.

#border {
    display:table;/*Webkit node fix*/
   [COLOR=Blue] width:896px;[/COLOR] [COLOR=Red] /*906 total with padding*/  [/COLOR]
    margin:0 auto;
    padding:[COLOR=Red]5px[/COLOR];
    list-style:none;
    word-spacing:-.25em;/*hide white-space nodes*/
    text-align:center;
    background:url(Borderbottom.png);    

   }

You shouldn’t need to set side paddings on the UL when centering the list items.

In this example below I set a 10px top and bottom padding on the UL and a 10px margin on the LI.

#border {
    display:table;/*Webkit node fix*/
    width:896px;    
    margin:[COLOR=Blue]20px[/COLOR] 0 0;
    [COLOR=Blue]padding:10px 0;[/COLOR]/*5px;*/
    list-style:none;
    word-spacing:-.25em;/*hide white-space nodes*/
    text-align:center;
    background:[COLOR=Blue]blue [/COLOR]url(Borderbottom.png);    
}
#border li {
    display:-moz-inline-box;/* FF2 & under */
    display:inline-block;/* for modern browsers */
    vertical-align:top;
    word-spacing:normal;
    text-align:center;
    [COLOR=Blue]margin: 10px;[/COLOR]    
    font-weight:bold;
}

Here is what I have as the complete test page with the #border UL added now.

You should probably change this image name: Assembly-&-turn-key.jpg
Remove the & from it: Assembly-turn-key.jpg

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>

<style type="text/css">
body {
    margin: 0;
    padding: 0;
    font: 100%/1.3 calibri, arial, helvetica, sans-serif;
    background: #000;
}
a img {border:0 none}

#container {
    width: 896px;  /*897px*/
    margin: 0 auto;
    padding:20px 0;
}
#header {
    height: 158px;
    background: url(Banner.png) no-repeat #0F0;
    overflow:hidden;/*uncollapse child margins*/
}

/*===== Begin Nav Bar ======*/
#navbar {
    margin: 20px 0 0;
    padding: 0px;
    list-style: none;
    overflow:hidden;/*contain floats*/
    background:yellow;
}
#navbar li {
    float: left;
}
#navbar a {
    float: left;
    height: 58px;/*group common rules*/
    text-decoration: none;
    /*text-indent: -5000px;*/
}
#navbar #home {
    width: 120px;
    background: url(Home.png) no-repeat 0 0;
}
#navbar #manufacturing {
    width: 154px;
    margin-left: 1px;
    background: url(Manufacturing.png) no-repeat 0 0;
}
#navbar #services {
    width: 121px;
    background: url(Services.png) no-repeat 0 0;
}
#navbar #aboutus {
    width: 129px;
    background: url(About-Us.png) no-repeat 0 0;
}
#navbar #contactus {
    width: 132px;
    background: url(ContactUs.png) no-repeat 0 0;
}
#navbar #requestforquote {
    width: 229px;
    background: url(RequestForQuote.png) no-repeat 0 0;
}
#navbar #home:hover,
#navbar #manufacturing:hover,
#navbar #services:hover,
#navbar #aboutus:hover,
#navbar #contactus:hover,
#navbar #requestforquote:hover {
    background-position: 0 -58px;
    background-color: red;
}

/*===== Begin Content Divs ======*/
#main-box {
    width:890px;
    min-height: 367px;
    margin: 20px auto 0;
    background:blue url(Body1.jpg) no-repeat;
    overflow:hidden;/*contain floats*/
}
    #main-inner {
        float: right;
        width: 435px;
        margin-top:130px;
    }
    #main-inner p {
        margin: 0;
        font: 20px/20px calibri,arial;
        color: #FFF;
        text-indent: 2em;
    }

/*===== Begin Left and Right Divs ======*/
#sub-box {
    width:100%;/*IE haslayout/contain floats*/
    overflow:hidden;/*contain floats*/
    margin:20px 0 0;
    padding: 5px 0 0;
    background:#CCC;
}
#left-box {
    float: left;
    height: 261px;
    width: 517px;
    background:red url(images/Leftimg.jpg) no-repeat;
}
    #left-inner {
        float: right;
        width: 350px;
        margin-top: 90px;
        background:#000;
    }
    #left-inner p {
        margin: 0;
        font: 20px/20px calibri,arial;
        color: #FFF;
    }

#right-box {
    float:right;
    width:360px; /*370px*/
    background:green;
}
    #right-inner {
        float: right;
        background:#000;
    }
    #right-inner img {
        display:block;
        width:280px;
        height:261px;
        background:orange;
    }

/*===== Begin Rollover List Items ======*/
#border {
    display:table;/*Webkit node fix*/
    width:896px;    
    margin:20px 0 0;
    padding:10px 0;/*5px;*/
    list-style:none;
    word-spacing:-.25em;/*hide white-space nodes (minimal value for new line in FF)*/
    text-align:center;
    background:blue url(Borderbottom.png);    
}
#border li {
    display:-moz-inline-box;/* FF2 and under */
    display:inline-block;/* for modern browsers */
    vertical-align:top;
    word-spacing:normal;
    text-align:center;
    margin: 10px;    
    font-weight:bold;
}
* html #border li {display:inline;} /*IE6*/
*+html #border li {display:inline;} /*IE7*/

#border a {
    float: left;
    width: 248px;/*group common rules*/
    height: 143px;/*group common rules*/
    text-decoration: none;
    text-indent: -5000px;
    /*text-indent: -5000px;*/
}
#border #precisionmachining {
    background:red url(Precision-Maching.jpg) no-repeat 0 0;
}
#border #precisionsheetmetal {
    background:red url(Precision-Sheet-metal.jpg) no-repeat 0 0;
}
#border #gasket {
    background:red url(Gasket-die-cutting-.jpg) no-repeat 0 0;
}
#border #assembly {
    background:red url(Assembly-&-turn-key.jpg) no-repeat 0 0;    
}
#border #engineering {
    background:red url(Engineering.jpg) no-repeat 0 0;     
}
#border #otherservices {
    background:red url(Quality-Assurance.jpg) no-repeat 0 0;    
}
#border #precisionmachining:hover,
#border #precisionsheetmetal:hover,
#border #gasket:hover,
#border #assembly:hover,
#border #engineering:hover,
#border #otherservices:hover {
    background-position: 0 -143px;
    background-color:lime;
}

#footer {
    width:100%;
    margin-top:20px;
    background:yellow;
    text-align:center;
    overflow:hidden;
}
</style>

</head>
<body>

<div id="container">
    
    <div id="header">
        <h1>Header Here</h1>
    </div>
    
    <ul id="navbar">
        <li><a href="home.html" id="home">Home</a></li>
        <li><a href="manufacturing.html" id="manufacturing">Manufacturing</a></li>
        <li><a href="services.html" id="services">Services</a></li>
        <li><a href="aboutus.html" id="aboutus">AboutUs</a></li>
        <li><a href="contactus.html" id="contactus">ContactUs</a></li>
        <li><a href="requestforquote.html" id="requestforquote">RequestforQuote</a></li>
    </ul>
    
    <div id="main-box">
        <div id="main-inner">
            <p><strong>&ldquo; With  more than 35 years of experience,<br>
            CUSTOM PRODUCT DEVELOPMENT CORPORATION<br>
            provides innovative/low cost engineered mechanical components and Turn-Key Assembly solutions. 
            Our technical design expertise, coupled with creative manufacturing and supply chain control, 
            ensures that our customers receive the best possible service available in today's competitive 
            industry.&rdquo;</strong></p>
        </div>
    </div>

    <div id="sub-box">    
        <div id="left-box">
            <div id="left-inner">
                <p><strong>We pride ourselves on Outstanding Customer Service and Product Quality. Whether you are 
                a current customer, or a potentially new customer, we take a genuine interest in your product 
                requirements. Customer loyalty is a priority at Custom Product Development Corporation.</strong></p>
            </div>
        </div>
        <div id="right-box">
            <div id="right-inner">
                <a href="#"><img src="images/Rightbodyimg.jpg" alt="This is an image"></a>
            </div>
        </div>
    </div><!-- end sub-box-->

    <ul id="border">
        <li><a href="precisionmachining.html" id="precisionmachining">Precisionmachining</a></li>
        <li><a href="precisionsheetmetal.html" id="precisionsheetmetal">Precisionsheetmetal</a></li>
        <li><a href="gasket.html" id="gasket">Gasket</a></li>
        <li><a href="assembly.html" id="assembly">Assembly</a></li>
        <li><a href="engineering.html" id="engineering">Engineering</a></li>
        <li><a href="otherservices.html" id="otherservices">Otherservices</a></li>
    </ul>
    
    <div id="footer">
        <p>Footer Stuff Here</p>
    </div>

</div><!-- end container-->

</body>
</html>

I tried the code mods but it still doesn’t space correctly in the box
the top 3 images should be under the blue line but there exceeding
see in the picture how it’s below the blue line and the bottom 3 images rest on the bottom blue line

here’s the test url
http://biz82.inmotionhosting.com/~mechte5/index.html

I tried the code mods but it still doesn’t space correctly in the box
Of course it didn’t work, I was just trying to show you how to make the adjustments yourself.
I did not have the images until your last post. :slight_smile:

You need to have a basic understanding of the “box model” and be able to do some simple math.

Your BG image is 401px tall and you need some top padding to push the first row of list items down. Something like 39px looks like it will get it down, now you need to account for the padding and subtract it from your UL height. We set a height so we can show the entire BG image and then set it as no-repeat for good measure.

http://www.css-lab.com/test/techbuilder.html

Should get it close to what you are after :wink:

#border {
    display:table;/*Webkit node fix*/
    width:896px;
    [B]height:362px;[/B][COLOR=Blue]/*401px total (img height) with top padding*/[/COLOR]
    margin:20px 0 0;
    [B]padding:39px 0 0;[/B][COLOR=Blue]/*top padding to push first row of LI down*/[/COLOR]
    list-style:none;
    word-spacing:-.25em;/*hide white-space nodes (minimal value for FF)*/
    text-align:center;
    background: url(http://biz82.inmotionhosting.com/~mechte5/Borderbottom.png) [B]no-repeat;[/B]    
}
#border li {
    display:-moz-inline-box;/* FF2 & under */
    display:inline-block;/* for modern browsers */
    vertical-align:top;
    word-spacing:normal;
    text-align:center;
    [B]margin: 4px 8px;[/B]/[COLOR=Blue]*4px top/bot margin and 8px lt/rt margins (vertical margins do not collapse)*/ [/COLOR]   
    font-weight:bold;
}

If you want the list items closer together horizontally then remove the 8px lt/rt margins and make it whatever you choose. I choose 8px because it helps line up the outside list items with the inner radius and round corners of the UL BG.

It also looks like your BG image may be off a little bit. You should also get out of the habit of making odd sized images (height 401px ?), it just makes things harder to line up. Why not 400px?

Your list item BG images are 143px tall, why not 142px?

Get the idea now :slight_smile:

You are a genius!!!

I see your point about heights and now I understand more about how the boxes work.

So would applying the border image, text and the rollover images be any different besides including a div for the text?

You need to remove the left margin on your 2nd li a in the top navbar. It’s causing a gap and it is not needed, it was leftover from your original code.


#navbar #manufacturing {
    width: 154px;
    [COLOR=Red]/*margin-left: 1px;remove this*/[/COLOR]
    background: url(Manufacturing.png) no-repeat 0 0;
}

One other thing, go back and remove all those funky BG colors I was using or replace them with a color that is close to the BG image. Your page will look like a rainbow with images off otherwise.

So would applying the border image, text and the rollover images be any different besides including a div for the text?

Not sure what you mean by that

If you are saying you want live text then it could go in the anchor.

I still have the bg colors you added on there
i thought I removed them all
where do you see them?

Ok so heres what I mean by adding the image on top of the image with text


On the blue image I would like to apply text and have a second image over the blue image.

How would I add the text to the blue image
would I just do a <div id=“bordertext”>
<p> text would be applied here</p>
</div>

I still have the bg colors you added on there
i thought I removed them all
where do you see them?
It looks like you got them all now, when I first viewed the link you gave the page was multicolored before the images loaded.

As far as your question about overlaying an image it is the same basic concept we have been doing all along. That is, set the main img as a BG image and then nest the inner img in this case.

Like I mentioned earlier, all presentation images should be set as backgrounds. If the inner image is actual html content then just nest it in the parent.

Depending on what your application is (I’m using a div below) that will determine what element you choose to wrap your text in (I’m using a <p> tag). Then just set a width on your text container and float it left, now float your image right and set a top margin to push it down.

You have to be careful about setting fluid text in a fixed height parent, it is generally discouraged to do that. You will have text spilling out if the user zooms “text only”

Something like this should give you an idea, I could have just as easily used a UL and LI but the concept would be the same. The only difference would be whether or not an anchor was in there. You can’t nest block level elements (<p>) within inline elements (<a>). You would need to use a <span> as your text container then.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test Page</title>

<style type="text/css">
body {
    margin:0;
    padding:0;
    font: 100%/1.4 arial,helvetica,sans-serif;
}
.imgwrap {
    width:430px;/*470px total w/padding*/
    height:230px;/*270px total w/padding*/
    margin:20px;
    padding:20px;
    background:cyan;
}
.imgwrap p {
    float:left;
    width:170px;
    margin:0;
    font-weight:bold;
    background:#CDF;
}
.imgwrap img {
    float:right;
    width:240px;
    height:100px;
    margin:130px 0 0;
    background:red;
}
</style>

</head>
<body>

<div class="imgwrap">
    <p>This is the text on the left side that will wrap alongside of the overlay image. This is the text on the left side that will wrap alongside of the overlay image.</p>
    <img src="foo.jpg" alt="inner image">
</div>

</body>
</html>

Alright makes since
and thanks for the example

you’ve been been really helpful
rayzur

Thanks again