July 31, 201214 yr Hi, I was wondering if anyone could help me. I am new to web design and am just getting to grips with my Adobe Dreamweaver CS5 software. At the moment I am trying to put a logo in my header section of my website however whenever I do it cuts off half of my logo and I can't get it to display. The logo is a png file and here is my current coding: #header { float:left; width:100%; height:250px; } #logo{ background: url('../Imgs/logo2.png')no-repeat; float:left; width:200px; height:200px; } I have tried lowering the width of the logo and height and also tried changing the properties of my header section but no matter what I do it doesn't work, I'm not sure if it is an issue with the logo itself - thank you for any help you can give me! I have attached a picture of how it looks at the moment. Edited July 31, 201214 yr by Renaissance-Design Please use the code button or tags to format your code.
July 31, 201214 yr #header { overflow: hidden; width:100%; height:250px; } #logo{ background: url('../Imgs/logo2.png')no-repeat; float:left; width:200px; height:200px; } Your header doesn't need to be a float because nothing is alongside it and it's 100% width. Applying overflow: hidden forces it to enclose the floated contents. Edited July 31, 201214 yr by Renaissance-Design
July 31, 201214 yr Hi, Try this, instead of loading ure image as a background image in the css add it to the html I have added an example below html: <header id="header"> <a href="homepage link" id="logo"> <img src="images/logo.png" /> </a> </header> css: #header { width:960px; height:200px; margin:0 auto; } header a#logo { position:relative; top:??px; left:??px; width:???px; height:???px; } I have f ound that by inserting the image in the html and sizing the id element in the css to the exact size works better for me, also with the relative position statement you can use the "top" & "left" styles to position the logo exactly where you want within the header. I hope this helps, best of luck. Charlie h. Edited August 1, 201214 yr by Renaissance-Design Please use the code button or tags to format your code.
July 31, 201214 yr Also when you are adding a background image in your css you don't need to use the ' ' at both ends you only need to do this: background:url(../images/logo.png)0 0 no-repeat; sorry for being picky
August 1, 201214 yr Author Hi, Try this, instead of loading ure image as a background image in the css add it to the html I have added an example below html: <header id="header"> <a href="homepage link" id="logo"> <img src="images/logo.png" /> </a> </header css: #header { width:960px; height:200px; margin:0 auto; } header a#logo { position:relative; top:??px; left:??px; width:???px; height:???px; } I have f ound that by inserting the image in the html and sizing the id element in the css to the exact size works better for me, also with the relative position statement you can use the "top" & "left" styles to position the logo exactly where you want within the header. I hope this helps, best of luck. Charlie h. Thank you so much for your help Charlie. It has worked - almost. But now the image is just too large and no matter what I do to resize it (changing the pixels) it doesn't help. Have I gone wrong in the codding you gave me? Where it says "homepagelink" what exactly am I to include there? Sorry for sounding like such a novice! And thank you for the advice on the background I will change that around as well! @ Renaissance-Design Thank you as well - I tried it in the light of day and it worked to an extent more of the logo appeared but half of it was still missing. Edited August 1, 201214 yr by Isla
August 1, 201214 yr Hi, I agree with "Renaissance-Design" the logo would appear to be to big for the css dimensions. If you have trouble resizing your logo reply to this message and attach the original .png or .jpg image file and type the dimensions you have set and ill sort it for you. Hope this helps. Charlie p.s. The part of the code that I wrote "homepage link" this would be the url of your website for example http://www.yourdomain.com. Edited August 1, 201214 yr by charlieh-starrtheme
August 1, 201214 yr Author Thank you very much both of you! I got it to work! Using a combination of both or your codes it now sits perfectly Thanks so much for your help you've been great I would have been lost figuring it out on my own.
August 1, 201214 yr Hi, No problem I am still learning myself so I know how important outside help is. So anytime you need any help give me a shout Hope your site comes together now . Charlie. p.s. I am new to this forum aswell and not sure how to thank ppl for help, any ideas? Edited August 1, 201214 yr by charlieh-starrtheme
August 1, 201214 yr Author Hi, No problem I am still learning myself so I know how important outside help is. So anytime you need any help give me a shout Hope your site comes together now . Charlie. p.s. I am new to this forum aswell and not sure how to thank ppl for help, any ideas? Thank you! I may take you up on that Charlie as I progress through this site
August 1, 201214 yr p.s. I am new to this forum aswell and not sure how to thank ppl for help, any ideas? You can give people Rep at the bottom right of their posts.
August 1, 201214 yr No problem dude, I am available most days due to having a spinal operation just over a week ago and my plan is to launch my web design business soon so I will be working from home everyday . Charlie.
Create an account or sign in to comment