- This topic is empty.
-
AuthorPosts
-
July 20, 2012 at 9:20 am #38990
Kaversen
MemberHi there!
I am making a site in HTML5 and CSS3.
I´m only just in the beginning and i have a slight problem..
I have a header (h1) and i have put a border around it, still to come is shade, but before the borders was coded, the header was aligned using CSS, to center. Now, with borders, it isn’t. Any suggestions for a solution?Oh and also how do i do something like the background on this site? (CSS-Tricks.com that is)
Thank you in advance!
July 20, 2012 at 9:58 am #106469Paulie_D
MemberThe background on CSS Tricks is done with a repeating background image.
Regarding your h1 tag (which is not a header by the way), most people don’t apply borders to them but if that’s your design then so be it.
You should be aware, however, that borders increase the dimensions of elements (unless specifically told not to…but that’s another story) and so if your h1 is positioned that precisely with CSS (which seems odd) then then you can expect some odd effects.
A link to a like site would be easiest to examine and advise but failing that, put the relevant code on Codepen and we can tinker with it.
July 20, 2012 at 10:32 am #106464Kaversen
MemberOkay, so my HTML5 and CSS3 May be bad :) that backgrounds i’ve Got to figure out!
July 20, 2012 at 10:59 am #106474Paulie_D
MemberLike I said, if you can give us a link to a live site or put your code on Codepen we might be able to assist further.
I’m not saying your code is bad (I haven’t seen it) but if you want to avoid borders and such causing these types of issues then you might want to consider adding
*{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}to your CSS.
July 21, 2012 at 6:37 pm #106554Kaversen
MemberSo now i think i am all set up on CodePen.io!
I´ve put in my HTML and CSS, so the site is produced :)
LINK: http://codepen.io/Kaversen/pen/soyFgHelp i greatly appreciated!
July 22, 2012 at 4:10 am #106571Paulie_D
MemberFirstly, you have put the h1 tag inside something called head outside of the body. I think you meant to put it in a header element inside the body.
See: http://codepen.io/anon/pen/GKewF
Now, exactly what positioning issues are you having?
July 22, 2012 at 5:49 am #106577Kaversen
MemberI want to center the header and button.. Is this using CSS or HTML?
When thats done, i just need to figure out some background stuff, and im all done!
(Im planning for using this on my school-website!)Thanks for the help!
July 22, 2012 at 5:54 am #106578Kaversen
MemberNow, i´ve also updated the code a bit. Is this how you ment the header should be placed in the code?
http://codepen.io/Kaversen/pen/soyFgJuly 22, 2012 at 6:21 am #106579wolfcry911
Participant -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.