css problems with center code
5 posters
Page 1 of 1
css problems with center code
Hi.
I've changed the navbar with a picture, and I've tried to center it with some center codes for css. But it doesn't work!
This is my code for the navbar pic:
#pun-head #pun-navlinks {
background-image:url('https://2img.net/h/oi44.tinypic.com/lguap.png'); }
#pun-head #pun-navlinks {
background-image:url('https://2img.net/h/oi44.tinypic.com/lguap.png');
background-repeat: no-repeat; }
#pun-head #pun-navlinks {
padding: 4.1em 1.5em 5.5em 1.1em;
background-color: transparent
border-color: #ffffff;
}
I don't know where to put the center codes, and if it does matter, but I've tried:
margin: 0 auto
and:
margin-left:auto;
margin-right:auto;
and then:
text-align: center
but none of them seems to work on my PunBB forum.
What to do??
I've changed the navbar with a picture, and I've tried to center it with some center codes for css. But it doesn't work!
This is my code for the navbar pic:
#pun-head #pun-navlinks {
background-image:url('https://2img.net/h/oi44.tinypic.com/lguap.png'); }
#pun-head #pun-navlinks {
background-image:url('https://2img.net/h/oi44.tinypic.com/lguap.png');
background-repeat: no-repeat; }
#pun-head #pun-navlinks {
padding: 4.1em 1.5em 5.5em 1.1em;
background-color: transparent
border-color: #ffffff;
}
I don't know where to put the center codes, and if it does matter, but I've tried:
margin: 0 auto
and:
margin-left:auto;
margin-right:auto;
and then:
text-align: center
but none of them seems to work on my PunBB forum.
What to do??
Last edited by Novaen on April 2nd 2012, 11:31 pm; edited 3 times in total
Re: css problems with center code
What is you need centered? Everything seems centered on your forum.
The codes go inside the selector that you want centered of course.
The codes go inside the selector that you want centered of course.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: css problems with center code
it's the picture I want to center. This screen shot is taken when I've zoomed out in the browser, but the pic should center too.
Re: css problems with center code
You can try it manual by adding this code:
- Code:
margin-left:Ypx; /*Y is a number*/
Light Elf- Forumember
- Posts : 144
Reputation : 11
Language : English
Re: css problems with center code
That image was centered when I visited your forum.
Make sure you set a width in percentage.
Make sure that goes in the same selector.
Make sure you set a width in percentage.
- Code:
width: 98%;
margin: 1px auto;
Make sure that goes in the same selector.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: css problems with center code
doesn't seems to work.
LGforum - well, I only see it when I zoom out on my board. If I've it in the normal stage it's just looking fine. I saw the little problem when I visited a friend, and her computer is bigger than mine, so it wasn't centred there.
LGforum - well, I only see it when I zoom out on my board. If I've it in the normal stage it's just looking fine. I saw the little problem when I visited a friend, and her computer is bigger than mine, so it wasn't centred there.
Re: css problems with center code
Add this to your CSS Stylesheet:
- Code:
#pun-navlinks ul {
text-align: center;
}
Re: css problems with center code
Hi,
I think its the background image that needs to be centered, you can use this CSS code...
I think its the background image that needs to be centered, you can use this CSS code...
- Code:
#pun-head #pun-navlinks {
background-position: center;
}
ankillien- Energetic
- Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL
Re: css problems with center code
ankillien - thanks! that solved my problem!
And thanks to your all for your good support!
/Nova
And thanks to your all for your good support!
/Nova
Similar topics
» Need to know how to center some code please
» Code breaks Navigation bar (center bar slide to the right)
» When i paste a long code via [code][/code] the page expands
» Problems understanding WHY my code looks the way the way it does
» Problems with code (Accordion)
» Code breaks Navigation bar (center bar slide to the right)
» When i paste a long code via [code][/code] the page expands
» Problems understanding WHY my code looks the way the way it does
» Problems with code (Accordion)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum