Results 1 to 9 of 9
-
13th Apr 2010, 11:29 AM #1OPMember
Center webpage with absolute positions?
I've googled and googled, nothings worked. I'm normally pretty wizzy with coding. But for some odd reason, I can't position this webpage center because it has absolute position with percentage used. I've done it before, cant remember how tho?
Here's the css code:
Code:body { background: #000000; } .top-nav { background-image: url('./images/topstrip.png'); background-position:center; background-repeat:no-repeat; position:absolute; width:1152px; height:93px; z-index:3; } .dscratch { top:10%; left:1.7%; position:absolute; z-index:3; } #navcontainer ul li { display: inline; } #navcontainer ul li a { padding: 0.9em 0.01em; color: White; text-decoration: none; float: right; } #navcontainer ul li a:hover { background-image: url('./images/active.hover.png'); background-repeat:no-repeat; background-position:center; color: #fff; } .blackbox { background-image: url('./images/topblock.png'); background-repeat:no-repeat; position:absolute; width:1152px; height:376px; z-index:99; top:10.5%; } .logo { left:2%; position:absolute; top:5%; z-index:100; } .designs { left:2%; position:absolute; top:50%; z-index:101; } .recentworks{ background-image: url('./images/recent_work.png'); background-repeat:no-repeat; width:auto; height:auto; top:15%; left:45%; position:absolute; z-index:102; } .bodybg { position:absolute; z-index:1; } .portfolioimg { left:0.5%; position:absolute; top:50.5%; z-index:105; border:0; } .supportimg { left:3%; position:absolute; top:66%; z-index:106; border:0; } .point2 { left:32.5%; position:absolute; top:68%; z-index:106; border:0; } .point3 { left:58%; position:absolute; top:66.5%; z-index:106; border:0; } .footer { background:#a0a0a0 url('./images/footer.png'); bottom:0; left:0.6%; top:121%; display:block; height:49px; position:absolute; float:bottom; text-align:right; vertical-align:baseline; width:1152px; z-index:115; } .overview { position:absolute; left:3%; top:98.8%; z-index:120; } .homecontent { position:absolute; left:16.5%; top:95%; width:790px; height:219px; z-index:120; } .footerguy { position:absolute; left:74.3%; top:97%; z-index:122; }
iL < Reviewed by iL < on . Center webpage with absolute positions? I've googled and googled, nothings worked. I'm normally pretty wizzy with coding. But for some odd reason, I can't position this webpage center because it has absolute position with percentage used. I've done it before, cant remember how tho? Here's the css code: body { background: #000000; } .top-nav { Rating: 5MSN: leslie@live.com.au
Skype: lesdog123
PSD 2 XHTML/CSS service.
PHP, jQuery, Java, MySQL service.
Previously employed at Sympact and Strem Art Design.
-
13th Apr 2010, 11:52 AM #2MemberWebsite's:
Rapidleech.com FullMaza.com WarezOcean.com MediaFireForum.comTry to add center code in body..
-
13th Apr 2010, 11:57 AM #3Respected Member
-
13th Apr 2010, 09:32 PM #4OPMember
Another odd thing,
it only makes div's that have backgrounds,
e.g
Code:.blackbox { background-image: url('./images/topblock.png'); background-repeat:no-repeat; position:absolute; width:1152px; height:376px; z-index:99; top:10.5%;
Code:<dov class="class"> <div class="class2"><img src=" "></div> </div>
MSN: leslie@live.com.au
Skype: lesdog123
PSD 2 XHTML/CSS service.
PHP, jQuery, Java, MySQL service.
Previously employed at Sympact and Strem Art Design.
-
13th Apr 2010, 11:10 PM #5Member
A link to the page would help.
as Loget said make a main container & add
margin-left:auto;margin-right:auto;
-
14th Apr 2010, 06:58 AM #6OPMember
Still didn't work Gav0,
http://www.jackleslie.com/portfolio/c/beta.phpMSN: leslie@live.com.au
Skype: lesdog123
PSD 2 XHTML/CSS service.
PHP, jQuery, Java, MySQL service.
Previously employed at Sympact and Strem Art Design.
-
14th Apr 2010, 07:30 AM #7MemberWebsite's:
proxxy.in scnpic.com w7s.orgthe simplest code is
PHP Code:.main-background
{
margin: 0 auto;
padding: 0;
background-color: #DBE5EB;
background-image: url('images/page_t.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: top center;
font-family: Arial, Helvetica, Sans-Serif;
font-style: normal;
font-weight: normal;
font-size: 12px;
color: #40535E;
}
-
14th Apr 2010, 07:33 AM #8OPMember
yeah, i don't have any help needed for the background codes tho..
or are you telling me to use background codes for all images instead of
<div class="class">
<img src="img">
</div> etc.. ?MSN: leslie@live.com.au
Skype: lesdog123
PSD 2 XHTML/CSS service.
PHP, jQuery, Java, MySQL service.
Previously employed at Sympact and Strem Art Design.
-
14th Apr 2010, 08:04 PM #9MemberWebsite's:
proxxy.in scnpic.com w7s.orguse background codes for all images, background/sheet/header then use <div class="class"><div>
its a bit cleaner and will validate your css
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Absolute url Vs Relative url.
By GBot in forum Whitehat SEOReplies: 0Last Post: 20th Dec 2013, 11:00 AM -
How do i align my webpage to the center?
By dtommy79 in forum Web Development AreaReplies: 6Last Post: 11th Jul 2011, 01:00 PM -
[Buying] Ad Positions
By netrun123 in forum Completed TransactionsReplies: 4Last Post: 15th Jan 2011, 10:50 AM -
[Shared] Absolute Free Offshore Hosting (3 Months)
By r@liablehost in forum ArchiveReplies: 14Last Post: 28th Sep 2010, 05:56 PM -
Whatever Happened to the Mod Positions
By robo-cop in forum Feedback and SuggestionsReplies: 7Last Post: 10th Aug 2008, 05:55 AM
themaCreator - create posts from...
Version 3.45 released. Open older version (or...