Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 16:11

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Noob Problem]CSS-HP im Center

Discussion on [Noob Problem]CSS-HP im Center within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2012
Posts: 601
Received Thanks: 131
[Noob Problem]CSS-HP im Center

Hallo Leute, Ich möchte meine ganze Homepage(nicht nur den Text) zentriert haben. Dafür arbeite ich mit CSS und HTML. Ich habe einen "Oberdiv" container erstellt und im css dann aufgerufen, so sieht der Code aus:
css-code:
Code:
#website{
      width:980px;
      margin: 0 auto;
}
und html code dann so:
HTML Code:
<div id="website">HIER DRINN DIE ANDEREN DIV'S </div>
so müsste es doch eigentlich gehen oder nicht? Tut es aber nicht!


mfg
.0nLy is offline  
Old 10/29/2012, 13:09   #2

 
boxxiebabee's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,222
Received Thanks: 500
Ja.
boxxiebabee is offline  
Old 10/29/2012, 13:09   #3
 
elite*gold: 0
Join Date: May 2012
Posts: 601
Received Thanks: 131
das Tut es aber nicht
.0nLy is offline  
Old 10/29/2012, 13:12   #4

 
boxxiebabee's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,222
Received Thanks: 500
Bitte nicht so viele Infos auf einmal.
Was passiert denn?
Zeig mal das ganze Html & CSS her.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style>
#wrapper {
	width: 980px;
	margin: 0 auto;
	background-color: #09F;
}
</style>
</head>

<body>
<div id="wrapper"> TEXT </div>
</body>
</html>
boxxiebabee is offline  
Old 10/29/2012, 13:13   #5


 
DasPrinzip.'s Avatar
 
elite*gold: 727
Join Date: Feb 2012
Posts: 1,206
Received Thanks: 303
meinst du vielleicht:
Code:
#website{
      width:980px;
      position: center;
}
?
DasPrinzip. is offline  
Old 10/29/2012, 13:32   #6
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
Quote:
Originally Posted by DasPrinzip. View Post
meinst du vielleicht:
Code:
#website{
      width:980px;
      position: center;
}
?
bitte was ?

@te :
hast du die css auch richtig eingebunden ? Oder verwirrt es dich nur, dass deine Schrift beispielsweise nicht 100 % in der Mitte ist sondern in deinem Div links sitzt ?
NotEnoughForYou is offline  
Thanks
1 User
Old 10/29/2012, 13:41   #7
 
elite*gold: 0
Join Date: May 2012
Posts: 601
Received Thanks: 131
Es ist richtig eingebunden.
Nein die komplette Homepage ist linksbündig der Text der ist in der Mitte das habe ich im Body bei der CSS eingebunden "text-align" ...
.0nLy is offline  
Old 10/29/2012, 13:45   #8
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
könntest du vlt. mal den code zeigen oder einen link geben ?
NotEnoughForYou is offline  
Old 10/29/2012, 13:47   #9

 
マルコ's Avatar
 
elite*gold: 1329
Join Date: Jun 2009
Posts: 1,873
Received Thanks: 960
Hast du einen Link? Das ginge am schnellsten, um das Problem zu finden...
Oder du gibst uns den Quelltext.

edit: verdammt, NE4Y war schneller^^
マルコ is offline  
Old 10/29/2012, 13:58   #10
 
elite*gold: 0
Join Date: May 2012
Posts: 601
Received Thanks: 131
Okay wenn ich wieder am pc bin stell ich Code rein von html und css

CSS Datei:
Code:
body{
    width:980px;
    background-color:CCCCCC;
    text-align:center;
}

#website{
        width:980px;
        margin: 0 auto;
}

#header{
        width:980px;
        height:150px;
        background:orange;
        border-radius:20px;
        margin-top:5px;
            
}

#navi{
        width:980px;
        height:40px;
        margin-top:10px;
        background:red;
        border-radius:10px;
}
#content{
        width:980px;
        height:600px;
        margin-top:10px;
        background:green;
        border-radius:20px;
}

#footer{
        width:980px;
        height:30px;
        margin-top:10px;
        background:yellow;
        border-radius:10px
}
HTML datei:

HTML Code:
<html>
    <head>
         <title>---Testseite---</title>
        <link rel="stylesheet" type="text/css" href="style.css"
        
    </head>   
    <body>
        <div id="website">
            <div id="header">
            <h1>Dein Titel</h1>
            </div>    
            <div id="navi"> Hallo
            </div>
            <div id="content">
                Hi,wie gehts?
            </div>
            <div id="footer">
                by Wadim
            </div>
            
        </div>
   
    </body> 
</html>
.0nLy is offline  
Old 10/29/2012, 16:01   #11
 
nephren's Avatar
 
elite*gold: 92
Join Date: Aug 2009
Posts: 731
Received Thanks: 971
Code:
margin-left:XXXpx;
In deine jeweiligen Div-Boxen =)


Code:
#header{
        width:980px;
        height:150px;
        background:orange;
        border-radius:20px;
        margin-top:5px;
	margin-left:500px;
nephren is offline  
Old 10/29/2012, 16:20   #12
 
devcode's Avatar
 
elite*gold: 10
Join Date: Feb 2012
Posts: 313
Received Thanks: 61
Lösch aus deinem body-tag die Breite, dann sollte es gehen.
devcode is offline  
Thanks
1 User
Old 10/29/2012, 16:22   #13
 
elite*gold: 0
Join Date: May 2012
Posts: 601
Received Thanks: 131
Okay ich probiere es später und sag dann bescheid


Immer wieder margin-left xx px zu schreiben ist doch auch nicht die richtige lösung oder?
.0nLy is offline  
Old 10/29/2012, 17:42   #14
 
Masterakio1995's Avatar
 
elite*gold: 8
Join Date: Apr 2009
Posts: 2,977
Received Thanks: 855
Quote:
Originally Posted by .0nLy View Post
Okay wenn ich wieder am pc bin stell ich Code rein von html und css

HTML datei:

Quote:
<html>
<head>
<title>---Testseite---</title>
<link rel="stylesheet" type="text/css" href="style.css">

</head>
<body>
<div id="website">
<div id="header">
<h1>Dein Titel</h1>
</div>
<div id="navi"> Hallo
</div>
<div id="content">
Hi,wie gehts?
</div>
<div id="footer">
by Wadim
</div>

</div>

</body>
</html>
Öhmmmmm... ?
Masterakio1995 is offline  
Old 10/29/2012, 17:51   #15
 
elite*gold: 0
Join Date: May 2012
Posts: 601
Received Thanks: 131
Quote:
Originally Posted by Masterakio1995 View Post
Öhmmmmm... ?
Ja was ist denn?
.0nLy is offline  
Reply


Similar Threads Similar Threads
[CENTER]hello people would ask how do programs and functions[/CENTER]
07/20/2010 - S4 League - 7 Replies



All times are GMT +1. The time now is 16:12.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.