...

View Full Version : Html or css ? background color edit.



RealDealSER
02-23-2011, 09:28 AM
hey guys im new to the forums. hello all :). im trying to change color/add images to the background of my webpage. by background i mean actually behind the actual center of the page/ to the left and right borders. currently they fade from grey to black.starting from the center. here is the html. i already screwed this up once pfff...ftw! i wanted to add different images to different pages as background/"border effects" if you will. am i even looking in the right place or is this in the CSS ? thnx for the help <.< :)



<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>%%TITLE%%</title>
<!--[if IE 7]>
<style>
p {
line-height:20px;
padding-bottom:0;
}
h1 {
font-size:20px;
font-weight:normal;
color:#fff;
padding-bottom:0;
}
h2 {
font-size:16px;
font-weight:normal;
color:#999999;
padding-bottom:0;
}
#navigation {
float:left;
background-color:#0a161b;
width:948px;
font-size:12px;
color:#060e11;
padding:16px 0px 0px 0px;
}
#navigation-links li {
float:left;
display:inline;
font-size:1em;
padding:0px 20px 10px 0px;
border:1px solid red;
}
</style>
<![endif]-->
</head>
<body>
<div id="wrapper">
<div id="sitename">%%TITLE%%</div>
<div class="weebly_header"></div>
<div id="navigation">%%MENU%%</div>
<div id="content-wrapper">
<div id="contents">
%%CONTENT%%
</div>
<div id="footer">
<div id="footer-contents">%%WEEBLYFOOTER%%<div>
</div>
</div>
</div>
</body>
</html>

Barons
02-23-2011, 09:58 AM
That would be your css for the color and background images.

Try adding something like this to the top of your page inside your css <style> tag.


body {
background-image:url(http://www.mysite.com/myimage.jpg);
background-repeat:no-repeat
background-color:#000000;
margin-left:auto;
margin-right:auto;
margin-top:0px;
}

This will put up your back ground image and and make the rest of the background black. If you google html color codes you can find a huge list of colors to choose from.

RealDealSER
02-23-2011, 10:06 AM
super fast reply, can you show me where , i dont wanna botch this up again...thnx






*|* {
margin:0pt;
padding:0pt;
}
body {
background: transparent url(background.gif) repeat-x center top;
background-color:#0d1216;
font-family:Georgia,"times new roman",serif;
font-size:13px;
color:#4f7288;
margin:0;
padding:0;
}
p {
line-height:1.5;
padding-bottom:12px;
}
h1 {
font-family:Georgia,"times new roman",serif;
font-size:20px;
font-weight:normal;
color:#fff;
line-height:1.5;
}
h2 {
font-family:Georgia,"times new roman",serif;
font-size:18px;
font-weight:normal;
color:#ffffff;
line-height:1.5;
}
#wrapper {
width:960px;
margin:0pt auto;
}
#sitename {
height:63px;
width:960px;
font-size:30px;
color:#cccccc;
font-weight:normal;
padding-top:25px;
}
#content-wrapper {
background:transparent url(content_background.jpg) repeat-x center top;
float:left;
width:960px;
margin-top:9px;
margin-right:0px;
padding-bottom:25px;
}
#navigation {
float:left;
background-color:#0a161b;
width:948px;
font-size:12px;
color:#060e11;
padding:16px 0px 0 12px;
}
#navigation ul {
float:left;
padding:0 10px 0 0;
margin-left:0;
}
#navigation li {
float:left;
display:inline;
height:30px;
font-size:1em;
padding:0px 20px 6px 10px;
}
#navigation a:link {
color:#fff;
text-decoration:none;
}
#navigation a:hover {
color:#fff;
text-decoration:none;
}
#navigation a:visited {
color:#fff;
text-decoration:none;
}
#active a:link {
color:#63afde;
text-decoration:none;
}
#active a:hover {
color:#63afde;
text-decoration:none;
}
#active a:visited {
color:#63afde;
text-decoration:none;
}
a:link, a:hover, a:visited {
color:#63afde;
font-weight:normal;
text-decoration:none;
}
.weebly_header {
background:transparent url(%%HEADERIMG%%) no-repeat center top;
float:left;
width:960px;
height:314px;
}
#contents {
width:920px;
min-height:500px;
height:auto !important;
height:500px;
padding:20px;
}
#footer {
float:left;
width:960px;
height:36px;
margin:20px 0 30px 0;
background-color:#0c1c23;
}
#footer-contents {
float:left;
font-family:Georgia,"times new roman",serif;
padding:11px 0px 0 20px;
width:940px;
height:28px;
}
input {
background-color:#394c5b;
border:1px solid #999;
font-size:12px;
color:#000000;
}
textarea {
background-color:#394c5b;
border:1px solid #999;
font-size:12px;
color:#000000;
}

div#commentArea div.blogCommentOwner {
background: #323242;
border: 1px solid #505060;
}


/****************************** flyout menus ******************************/

#weebly-menus .weebly-menu-wrap {
z-index: 5000;
}

#weebly-menus .weebly-menu {
padding: 0;
margin: 0;
list-style: none;
}

#weebly-menus .weebly-menu li {
float: left;
clear: left;
width: 170px;
text-align: left;
}

#weebly-menus .weebly-menu li a {
position: relative;
display: block;
width: 100%;
background: #2a3e4e;
border-right: 1px solid #394c5b;
border-left: 1px solid #394c5b;
border-bottom: 1px solid #394c5b;
text-decoration: none;
font-size: 11px;
font-weight: normal;
line-height:1;
padding:5px;
color: #fff;
}

#weebly-menus .weebly-menu li a:hover {
background: #2a3e4e;
}

#weebly-menus span.weebly-menu-title {
display: block;
padding: 5px 10px;
}

#weebly-menus span.weebly-menu-more {
background: transparent url(http://images.weebly.com/weebly/images/submenu_arrow.gif) no-repeat center top;
display: block;
position: absolute;
right: 5px;
top: 0;
font-family: Courier;
height: 28px;
line-height: 28px;
padding:3px 0 3px 0;
}

Excavator
02-23-2011, 04:58 PM
Hello RealDealSER,
You already have an image as a background of your body. Are you able to reaplace it or is it need along with your new image? If you can replace it, just put your image where I've highlighted in red below (you may or may not want to keep that repeat property) -


*|* {
margin:0pt;
padding:0pt;
}
body {
background: transparent url(background.gif) repeat-x center top;
background-color:#0d1216;
font-family:Georgia,"times new roman",serif;
font-size:13px;
color:#4f7288;
margin:0;
padding:0;
}
p {
line-height:1.5;
padding-bottom:12px;
}
h1 {
font-family:Georgia,"

See the w3schools page on background (http://www.w3schools.com/css/pr_background-position.asp).

When posting code in the forum, please use the code tags, &#91;code&#93;&#91;/code&#93; - available with the # button in the post edit window.
This will wrap your code in a scroll box which greatly helps the readability of your post. You can go back and edit your posts to add them.

RealDealSER
02-23-2011, 07:33 PM
Thanks for the fast replies. i do want to keep the existing image and just overlay it with a picture on the left and right sides of the screen. should i design the image as a full screen image (favoring the left and right sides ) and just leave the background of the image transparent so the existing coloR is visible? thnx.

Excavator
02-23-2011, 11:21 PM
Thanks for the fast replies. i do want to keep the existing image and just overlay it with a picture on the left and right sides of the screen. should i design the image as a full screen image (favoring the left and right sides ) and just leave the background of the image transparent so the existing coloR is visible? thnx.

It's kind of hard to answer that without seeing your images.
It may be that nesting another div with your left/right border image centered and repeated on the y axis will work for you.

RealDealSER
02-25-2011, 06:49 AM
Sweet, got it! only problem now is when i add text boxes and pics, their running onto the background instead of being backed up by the Page...pfff




*|* {
margin:0pt;
padding:0pt;
}
body {
background: transparent url(imagE1.jpg) repeat-x center top;
background-color:#0d1216;
font-family:Georgia,"times new roman",serif;
font-size:13px;
color:#4f7288;
margin:0;
padding:0;
}
p {
line-height:1.5;
padding-bottom:12px;
}
h1 {
font-family:Georgia,"times new roman",serif;
font-size:20px;
font-weight:normal;
color:#fff;
line-height:1.5;
}
h2 {
font-family:Georgia,"times new roman",serif;
font-size:18px;
font-weight:normal;
color:#ffffff;
line-height:1.5;
}
#wrapper {
width:960px;
margin:0pt auto;
}
#sitename {
height:63px;
width:960px;
font-size:30px;
color:#cccccc;
font-weight:normal;
padding-top:25px;
}
#content-wrapper {
background:transparent url(content_background.jpg) repeat-x center top;
float:left;
width:960px;
margin-top:9px;
margin-right:0px;
padding-bottom:25px;
}
#navigation {
float:left;
background-color:#0a161b;
width:948px;
font-size:12px;
color:#060e11;
padding:16px 0px 0 12px;
}
#navigation ul {
float:left;
padding:0 10px 0 0;
margin-left:0;
}
#navigation li {
float:left;
display:inline;
height:30px;
font-size:1em;
padding:0px 20px 6px 10px;
}
#navigation a:link {
color:#fff;
text-decoration:none;
}
#navigation a:hover {
color:#fff;
text-decoration:none;
}
#navigation a:visited {
color:#fff;
text-decoration:none;
}
#active a:link {
color:#63afde;
text-decoration:none;
}
#active a:hover {
color:#63afde;
text-decoration:none;
}
#active a:visited {
color:#63afde;
text-decoration:none;
}
a:link, a:hover, a:visited {
color:#63afde;
font-weight:normal;
text-decoration:none;
}
.weebly_header {
background:transparent url(%%HEADERIMG%%) no-repeat center top;
float:left;
width:960px;
height:314px;
}
#contents {
width:920px;
min-height:500px;
height:auto !important;
height:500px;
padding:20px;
}
#footer {
float:left;
width:960px;
height:36px;
margin:20px 0 30px 0;
background-color:#0c1c23;
}
#footer-contents {
float:left;
font-family:Georgia,"times new roman",serif;
padding:11px 0px 0 20px;
width:940px;
height:28px;
}
input {
background-color:#394c5b;
border:1px solid #999;
font-size:12px;
color:#000000;
}
textarea {
background-color:#394c5b;
border:1px solid #999;
font-size:12px;
color:#000000;
}

div#commentArea div.blogCommentOwner {
background: #323242;
border: 1px solid #505060;
}


/****************************** flyout menus ******************************/

#weebly-menus .weebly-menu-wrap {
z-index: 5000;
}

#weebly-menus .weebly-menu {
padding: 0;
margin: 0;
list-style: none;
}

#weebly-menus .weebly-menu li {
float: left;
clear: left;
width: 170px;
text-align: left;
}

#weebly-menus .weebly-menu li a {
position: relative;
display: block;
width: 100%;
background: #2a3e4e;
border-right: 1px solid #394c5b;
border-left: 1px solid #394c5b;
border-bottom: 1px solid #394c5b;
text-decoration: none;
font-size: 11px;
font-weight: normal;
line-height:1;
padding:5px;
color: #fff;
}

#weebly-menus .weebly-menu li a:hover {
background: #2a3e4e;
}

#weebly-menus span.weebly-menu-title {
display: block;
padding: 5px 10px;
}

#weebly-menus span.weebly-menu-more {
background: transparent url(http://images.weebly.com/weebly/images/submenu_arrow.gif) no-repeat center top;
display: block;
position: absolute;
right: 5px;
top: 0;
font-family: Courier;
height: 28px;
line-height: 28px;
padding:3px 0 3px 0;
}

Excavator
02-25-2011, 05:23 PM
Sweet, got it! only problem now is when i add text boxes and pics, their running onto the background instead of being backed up by the Page...pfff


I'm not sure at all what you're describing there...



*|* {
margin:0pt;
padding:0pt;
}
I've never seen that. Is that something you found or did you add that yourself? It's not valid CSS 2.1 so it's not likely to be the reset you were probably trying for.
More typically that would look like this -

* {
margin: 0;
padding: 0;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum