...

View Full Version : Problem inserting image in the right column



Mccall101
03-31-2009, 04:08 PM
I want to add a image on the right column of my website. I did the whole background: url(images/News.png) in my css but it didn't work. I uploaded the image into my ftp and it still didn't work. Any ideas?

Mccall101
03-31-2009, 04:12 PM
alright nvm it showed up now but it was way to big (thats what she said) I'll have to resize it. But I know I'll have a prob in a sec adding links into there with it messing up my nav links. Help

Excavator
03-31-2009, 04:26 PM
Hello Mccall101,
How's it been going?

A link to your site might help others help you, at least some code so they know what your trying.

For links in your right column, just give the ul an id and style it seperately from your nav links.

Mccall101
03-31-2009, 04:38 PM
Hey there. Well I got it placed on my site but i want to position it better. When I put some padding top on it a little sliver of a different color showed up.

[CODE]body{
text-align: center;
background: #ccd8e1;
font: 16px Helvetica, arial, sans-serif;
}
* {
margin: 0;
padding: 0;
border: none;
}
#container {
width: 1023px;
margin: 0 auto;
}
#header {
width:1023px;
height:242px;
background:url(http://www.skodesigns.com/images/SKODesigns2_02.png) no-repeat;
}
#nav {
width: 1023px;
height: 114px;
background:url(http://www.skodesigns.com/images/SKODesigns2_03.png) no-repeat;
text-align: center;
}
li {
list-style-type: none;
display: inline;
padding: 0 32px;
text-decoration: none;
font: 18px/80px Helvetica;

}
#content {
width: 1023px;
height: 620px;
background:url(images/SKODesigns2_05.png) no-repeat;
text-align: left;
}

#footer{

position: center;
width: 1023px;
height: 22px;
background-image: url(images/SKODesigns2_07.png);
background-repeat: repeat-y;
color: white;
}

p {
margin: 10px;
text-align: left;
color: #fff;
text-indent: 10px;
}

h2{
text-align: left;
text-indent: 0.5cm;
padding-top: 20px;
color: white;
text-decoration: none;
font-family: Arial Rounded MT Bold;

}


#left {
float: left;
width: 600px;
}

#right {
margin: 0 0 0 600px;
background-image: url(images/News.png) no-repeat;
width: 341px;
height: 391px;
;
}


a {
Color: blue;
text-decoration: none;
}

h3{text-align: left;
text-indent: 0.5cm;
padding-top: 20px;
color: white;
text-decoration: none;
font-family: Arial Rounded MT Bold;
}

form{
width: 200px;
text-align: center;
padding-top: 20px;
}[CODE]

I wanna push it down a little and to the right

abduraooft
03-31-2009, 04:44 PM
I wanna push it down a little and to the right Push what? We are not psychic to guess your corresponding html code! Please follow http://www.codingforums.com/postguide.htm AFAP.

Excavator
03-31-2009, 04:52 PM
#right {
margin: 0 0 0 600px;
background-image: url(http://www.skodesigns.com/images/News.png) no-repeat;
width: 341px;
height: 391px;
background-position: center;
}

That's not valid.

Excavator
03-31-2009, 04:55 PM
#right {
margin: 0 0 0 600px;
background: url(http://www.skodesigns.com/images/News.png);
height: 391px;
}

Your posted code above needs edited to fix the closing tag. It should look like this - [/code]

Mccall101
03-31-2009, 05:18 PM
is that gonna make it go to the right and sorta in the center of the right column?

Excavator
03-31-2009, 05:32 PM
is that gonna make it go to the right and sorta in the center of the right column?

No, that will make the background image the full width of the 391px tall #right.
Try it and see. If that's not quite what you want, maybe you could explain a little better what you do want it to look like and I'm sure we can do that. I'm just not sure what you're after when you say "position it better."

Mccall101
03-31-2009, 05:53 PM
Like I want it in the center of my right column. I want some space all around. It's just gonna be a News column

Excavator
03-31-2009, 06:25 PM
You can try it like this. I just put the border around it so you could see what size the right column is...

#right {
margin: 0 0 0 600px;
padding: 20px 0 0 0;
background: url(http://www.skodesigns.com/images/News.png) no-repeat center;
height: 391px;
border: 1px solid #f00;
}

Mccall101
03-31-2009, 06:36 PM
You can try it like this. I just put the border around it so you could see what size the right column is...

#right {
margin: 0 0 0 600px;
padding: 20px 0 0 0;
background: url(http://www.skodesigns.com/images/News.png) no-repeat center;
height: 391px;
border: 1px solid #f00;
}

Have I told you how awesome you were today? :p

Mccall101
03-31-2009, 06:41 PM
Now how do I align the text in the column? would I do it in css or html?

Excavator
03-31-2009, 07:40 PM
Have I told you how awesome you were today? :p

Actually, you've only thanked 3 people ever.


Join Date: Nov 2008
Posts: 79
Thanks: 3
Thanked 0 Times in 0 Posts


Put your NEWS text in a div that's centered in the right column. You can move that image into it instead of the way it's positioned now too.
By putting another div in the right column you'll have more control over the different things you'll be putting in a news box, like header, links and a few sentences.

Excavator
03-31-2009, 08:49 PM
Try this -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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>
<style type="text/css">
html, body {
font: 14px "Comic Sans MS";
background: #FC6;
text-align: center;
}
* {
margin: 0;
padding: 0;
outline: none;
border: none;
}
#container {
width: 1023px;
margin: 30px auto;
background: #999;
overflow: auto;
}

#left {
float: left;
width: 600px;
}
#right {
margin: 0 0 0 600px;
text-align: left;
}
.box {
width: 341px;
height: 391px;
margin: 10px auto 0;
background: url(http://www.skodesigns.com/images/News.png);
}
h3 {
font-size: 18px;
line-height: 18px;
color: #FFF;
background: #666;
}
.box p {margin:10px;}
</style>
</head>
<body>
<div id="container">
<div id="left">
</div>
<div id="right">
<div class="box">
<h3>News</h3>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo
duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
</p>
<!--end .box--></div>
<div class="box">
<h3>Info</h3>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
</p>
<!--end .box--></div>
<!--end right--></div>
<!--end container--></div>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum