Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Aurelian Spodarec
7,369 PointsCould somebody help me with my banner?
Hi, Im trying to copy this webpage .
I did get a bit help on the beginning , and I'm learning it and doing it so when i finish it, it will be like a resource to learn form and apply it from .
But as I'm going throw it, not everything is going as i though it will go as well as i repeated my self .
Could somebody give me a tip or say what could i change ?
1 Answer
Matthew Greenberg
8,173 PointsI would start by setting the headbar to position: fixed. It looks like the example headbar has no margin or padding, display block, width 100% ect.
Watch this course.
Aurelian Spodarec
7,369 PointsAurelian Spodarec
7,369 PointsWhat do you mean head bar?
Matthew Greenberg
8,173 PointsMatthew Greenberg
8,173 PointsSorry I meant header not head bar. header is the ID name of your header in your html file. So the css would be...
There is bunch more styling you would need to make it look clean, but thats the start of it.
Aurelian Spodarec
7,369 PointsAurelian Spodarec
7,369 PointsYou make me confuse : p you mean style of the webpage or ? because I'm looking to make clean code on my banner : p
Matthew Greenberg
8,173 PointsMatthew Greenberg
8,173 PointsPlease be as descriptive as you can and I will try to guide you.
Aurelian Spodarec
7,369 PointsAurelian Spodarec
7,369 PointsUm, i meant :
If you look at the banner e.g. inside the code , and you look inside the banner box, in CSS , the code is a little bit messy so the position of it. Im pretty sure it shouldn't me layer out like that because its a bad code .
And my question is if theres anyone who can give me a tip on it or make some changes to make the banner code clear . So its clean and good.
As e.g. if you look at the two buttons on the right, look at their CSS and I'm sure their messy , not saying about the repeating.
I hope this is enough descriptive : p
Aurelian Spodarec
7,369 PointsAurelian Spodarec
7,369 PointsHere i made the changes now, http://codepen.io/anon/pen/NPGqBb . I meant to look at this now ; p or just any tbh i guess
Matthew Greenberg
8,173 PointsMatthew Greenberg
8,173 PointsYou need to learn how to DRY your code out. You have a lot of unnecessary classes in your html markup and you reuse alot of css. For example in the css...
This code is big and repeats a lot of styles. You also have attributes that are overwriting styles you had previously declared. For example...
You set the margin-right property to 2em, then overwrite it below by setting margin to auto.
Try this instead...
Hope this helps a bit. You should really watch the tutorials on css
Aurelian Spodarec
7,369 PointsAurelian Spodarec
7,369 PointsThank for this but what I'm more interested : p is the layout .
I mean , if you look how this is positioned in the banner, e.g. top:-180px etc.. this stuff