Bonjour à tous,
Voila, j'ai commencé l'ASP.NET il y a peu. Je suis arrivé aux MasterPage, ce qui est, je trouve, d'une bonne utilité !
Mais voila, j'ai un petit problème pour centrer ma page pour tous types de résolutions d'écran... J'utilise une feuille de style pour ce faire. Je vous passe le code ASP.NET et ce qu'il en suit en CSS :
Voici le code de ma Master Page
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Page sans titre</title>
</head>
<body style="background-color: #000000" id="class1">
<form id="form1" runat="server">
<div style="left: 50%; top: 0px" id="contenu">
<asp:Panel ID="Panel1" runat="server" Height="147px" Style="z-index: 100; left: -1px;
position: absolute; top: 0px" Width="1000px">
<img src="mus.jpg" style="z-index: 100; left: 87px; width: 835px; position: absolute;
top: 20px; height: 110px" />
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" Height="376px" Style="z-index: 101; left: 0px;
position: absolute; top: 146px" Width="177px">
<asp:Menu ID="Menu1" runat="server" BackColor="#B5C7DE" DynamicHorizontalOffset="2"
Font-Names="Verdana" Font-Size="Medium" ForeColor="#284E98" Height="66px" StaticSubMenuIndent="10px"
Style="z-index: 100; left: 0px; position: absolute; top: 0px" Width="176px">
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#284E98" ForeColor="White" />
<DynamicMenuStyle BackColor="#B5C7DE" />
<StaticSelectedStyle BackColor="#507CD1" />
<DynamicSelectedStyle BackColor="#507CD1" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<Items>
<asp:MenuItem NavigateUrl="~/acceuil.aspx" Text="Acceuil" Value="Acceuil"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/historique.aspx" Text="Historique" Value="Historique"></asp:MenuItem>
</Items>
<StaticHoverStyle BackColor="#284E98" ForeColor="White" />
</asp:Menu>
</asp:Panel>
<asp:Panel ID="Panel3" runat="server" BackColor="#B5C7DE" Height="377px" Style="z-index: 103;
left: 177px; position: absolute; top: 146px" Width="824px">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</asp:Panel>
</div>
</form>
</body>
</html>
Et voici ce que j'ai essayé pour centrer ma page en CSS :
#contenu
{
width:800px;
margin-left: auto;
margin-right : auto;
}
Je tiens à signaler que contenu est l'id du bloc div.
Ce que j'ai trouvé se trouvais déjà sur le forum mais cela ne résoud pas mon problème...
Merci de m'aider,
A bientot, Le Grand Jisay