EOSERV Forum > Lounge > ids classes and divs in css/html
Topic is locked.
Page: << 1 >>
ids classes and divs in css/html
Author Message
Post #67398 ids classes and divs in css/html

Hmmmmmm.  So i was working on a website, and since im usually just putting in the backgrounds VIA html, i decided to use classes.  I have my css file all setup, and all my classes are setup like soo.


#banner

{

   background-image:url(img/content-bottom.png);

}


I am centering the pictures via html so no need for anything like that.  Not i try to embed it to the webpage.(index.php).


<div class="banner">

</div>


&


<div class="#banner">

</div>


can i get some help D:?

14 years, 7 weeks ago
Post #67401 Re: ids classes and divs in css/html


So is this a php site and can u be a little more specific on what you need help with?

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
14 years, 7 weeks ago
Post #67405 Re: ids classes and divs in css/html

No, its not a php site, but i will be using PHP through out most of the pages.


My question is how can i insert a background via a stylesheet.  and i also need it centered.


Once its in my stylesheet how do i put it into my webpage(index.php)

14 years, 7 weeks ago
Post #67406 Re: ids classes and divs in css/html

Its gotta be the "Style.css" it will automaticaly be used in the right format, as long as it is set up properly.

14 years, 7 weeks ago
Post #67408 Re: ids classes and divs in css/html


well it will be named index.html as homepage, then the background will be

<body style="background-image: url('file:///C:/Users/Andrew/Desktop/Web/Images/Background.jpg')" background-position: center">

</body>

Replace the file with the loc of your image

 

---
Andrewbob - I would be on the fucking copter of rofls

Programmer, Web Developer, and Graphics Designer
14 years, 7 weeks ago
Post #67410 Re: ids classes and divs in css/html

In html, the use of ID's and classes are different. For what you are doing you will need to use the class identifier, not the ID identifier.


.banner
{
  background-image:url(img/content-bottom.png);
}


<div class="banner"></div>



The alternate way is:


#banner

{

  background-image:url(img/content-bottom.png);

}


<div id="banner"></div>



And the easiest way to center your image is to use a display block and auto margin, don't forget to set the image height and width in css:


div.banner
{
display: block;
margin-left: auto;
margin-right: auto;
background-image:url(img/content-bottom.png);
height: 48px;
width: 48px; <!--Set image height and width-->
}

<div class="banner">
&nbsp;
</div>



Hope that helps.

---
Web developer, currently looking for graphic artists / designers.
14 years, 7 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Lounge > ids classes and divs in css/html