This is a discussion on "[SOLVED] Newbie having a few CSS problems!!" within the Web Page Design section. This forum, and the thread "[SOLVED] Newbie having a few CSS problems!! are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Newbie having a few CSS problems!!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Newbie having a few CSS problems!!
Hi I am working on the layout of my first website. I am having a few teething problems and was wondering If anybody could help??
I have commented the problems in the css file. Heres the HTML:
I would like to display the logo gif image using css i.e backgroung-image: url... The borders dont seem to be working on the header / sub header divs. I have created a container div to hold my sidebar and content. Ideally I would like the content div to fill the space to the right of the sidebar (less the padding/margin). The footer is placing itself in the container div, I thought by placing the footer div tags outside the container div tags in the html would cause the footer to be below it. It seems not!! Thanks in advance for any help... Graeme. Last edited by karinne; Sep 27th, 2007 at 12:37. Reason: Please use the proper vBcode tags when inserting code in your posts |
|
|
|
|||
|
Re: Newbie having a few CSS problems!!
For the border that is not working change the order.
Pixels first, thin then color. Also add spacing. example: border: 3px thin #000000; Fix the other one below in your css as well *************************************** for this one:
background-image: url (logo.gif) ; And I do not see a div id="logo"></div> anywhere in your html? ************************************************** ****
width: 400px; Ok.. I just made up that pixel amount, play with the code until you have it filled up enough without throwing the rest of the design out of whack. ************************************************** ******** Footer Div issue: You have:
Test this and see:
|
|
||||
|
Re: Newbie having a few CSS problems!!
|
|
|||
|
Re: Newbie having a few CSS problems!!
Hi thanks for the advice.....the logo url is now working.. but he borders are still not showing...there was spacing in the coding but after pasting it it must have disappeared??
And the footer is still positioning itself in the container....I didnt alter the coding for this as I think it should work...the bottom div tag is for the body div tags. Heres the css for the borders now: #subheader { background:black; height:30px; border-left:3px thin red;/*borders not working*/ border-bottom:3px thin red; border-right:3px thin red; } I have also tried using the bottom attribute in the footer tag: #footer/*placing itself it main container*/ { margin-top:15px; background:black; height:25px; margin-bottom:15px; bottom:10px; } But still no joy Last edited by Graeme36; Sep 27th, 2007 at 20:54. Reason: errors in original |
|
|||
|
Re: Newbie having a few CSS problems!!
Hi just an update the border problem is solved:
border-right:solid thin black; Seemed to work. Last edited by Graeme36; Sep 27th, 2007 at 21:15. Reason: . |
|
||||
|
Re: Newbie having a few CSS problems!!
Quote:
border-right: 1px solid #000000; but its up to you
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: Newbie having a few CSS problems!!
Just an update......I think I'm getting there slowly but surely
I'm still having the footer problems, placing itself in the main container?? Also I have used width:450px; , for spacing out the content div....it looks great in VWD.....but when I debug it in IE .....it's either too big in a restored down window or too small in a maximized window????? Is using percentages rather the px's the way to go ?? Ideally I would like to use the remaining space to the right of the sidebar (less the padding) for my main content. Why isnt there a remainder width property in CSS Graeme. |
|
|||
|
Re: Newbie having a few CSS problems!!
Hi Adrock
My coding has been indented, but when I copy/pasted to here the coding left aligned itself. I will repaste the coding and edit it, and perhaps you could then tell me where I'm going wrong... HTML: <%@MasterLanguage="C#"AutoEventWireup="true"CodeFile="MasterPage.master.cs"Inherits="MasterPage" %> <!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml"> <headrunat="server"> <title>Untitled</title> <linkhref=StyleSheet.csstype="text/css"rel=Stylesheet/> </head> <body> <formid="form1"runat="server"> <divid="body"> <divid="header"> <divid="logo"></div> <divid="headeraddress"> *********************<br/> *************<br/> ****************<br/> ***********<br/> ******************************<br/> ***************************** </div> </div> <divid="subheader"></div> <divid="container"> <divid="sidebar"> <divid="sidebarheader"></div> </div> <divid="content"> <asp:ContentPlaceHolderID="ContentPlaceHolder1"runat="server"> </asp:ContentPlaceHolder> </div> </div> <divid="footer"></div> </div> </form> </body> </html> CSS body { margin:25px 75px 25px 75px; padding:0; background:white; } #header { background: red; height: 180px; border-left: solid 2px black; border-top:solid 2px black; border-right:solid 2px black; } #logo { margin-left:10px; margin-top:10px; float:left; height: 160px; width: 160px; border:solid 2px black; background-image: url(logo.gif); } #headeraddress { padding-top:20px; padding-right:10px; float:right; text-align:right; color:white; font-style:italic; font-size:14pt; font-weight:bolder; } #subheader { background:black; height:30px; } #container/*container for sidebar and content*/ { margin-top:15px; } #sidebar { background:red; width:180px; height:300px; float:left; border:solid 2px black; } #sidebarheader { background:black; height:30px; } #content { float:right; padding-left:10px; /*would like to fill the remainder of the space to the right of the sidebar*/ width:450px;/*works ok in VWD IDE yet when run in IE is either too big or too small depending on size of window*/ border:solid 2px black; height:450px; } #footer/*placing itself it main container*/ { margin-top:15px; background:black; height:25px; margin-bottom:15px; bottom:10px; } Last edited by Graeme36; Sep 29th, 2007 at 11:45. Reason: formatting code |
|
||||
|
Re: Newbie having a few CSS problems!!
Has it been published yet or are you testing locally
|
|
|||
|
Re: Newbie having a few CSS problems!!
It wouldnt let me indent the code without it realigning to the left, so I have spaced out the <div> sections maybe this is a bit more understandable.
|
|
|||
|
Re: Newbie having a few CSS problems!!
No its still early days yet I'm only testing locally
|
|
||||
|
Re: Newbie having a few CSS problems!!
Just by looking at your code, i'm surprised if the stylesheet works
should be
|
|
|||
|
Re: Newbie having a few CSS problems!!
Hi,
I dont know where [color=#000080][html]<linkhref=StyleSheet.csstype="text/css"rel=Stylesheet/ came from?? there is no color or html tag within the code, and there is spacing within the <link> tag I haven't tried your indented version as looking at it most of the divs are within the header tag.....will this not place all my formatting within the header?? The way I had it was same as this only the penultamite closing <div> is used to close the header div just after the headeraddress closing div. I thought I'd better try out your version before I posted, and my thoughts were correct, everything is showing in the header. I still cant understand why the footer is not showing outside the container?? |