- This topic is empty.
July 20, 2012 at 9:20 am #38990
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 #106469
The 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 #106464
Okay, so my HTML5 and CSS3 May be bad :) that backgrounds i’ve Got to figure out!July 20, 2012 at 10:59 am #106474
Like 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
to your CSS.July 21, 2012 at 6:37 pm #106554
So now i think i am all set up on CodePen.io!
I´ve put in my HTML and CSS, so the site is produced :)
Help i greatly appreciated!July 22, 2012 at 4:10 am #106571
Firstly, 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.
Now, exactly what positioning issues are you having?July 22, 2012 at 5:49 am #106577
I 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 #106578
Now, 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 #106579
- The forum ‘CSS’ is closed to new topics and replies.