Nov 28th, 2007, 11:26 PM
#1
Thread Starter
Fanatic Member
[resolved] CSS and MasterPage-style not showing in pages
I have a box template css file that i have a <link href..> in the <head> of the Master Page:
Code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link href="App_Themes/Theme1/zebula.css" rel="stylesheet" type="text/css" />
<title>Untitled Page</title>>
</head>
<body>
<form id="form1" runat="server">
<div id="centercontent">
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</div>
</form>
</body>
</html>
The div uses centercontent from the css file that basically creates a box centered for content.
Code:
#centercontent {
background:#fff;
margin-left: 199px;
margin-right:199px;
border:1px solid #000;
voice-family: "\"}\"";
voice-family: inherit;
margin-left: 201px;
margin-right:201px;
}
html>body #centercontent {
margin-left: 201px;
margin-right:201px;
}
default page codebehind
Code:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="testOfCSSwithMasterPage.aspx.vb" Inherits="testOfCSSwithMasterPage" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
jfkdjfkdsfdsfasdfdsfdsfdsfdsfdsfdsafdsfsdfsdjfksdjfkjdslkjfkldjfkldsjflkjds;lkfjdsklfjlkdsjfkjds;klfjs;dkjfjdsfjsdajfsdjfkjsdfjsdkjfdskjf;slkdjf;kdsjf;kldsf
dfas;kfdjskl;fjkldsjfk;lsdaf
fjkdsafjkadsjfkdsfjksdlfj;lkdsjfkldsjfkl;jdsa;lkfjsda;lkfa
</asp:Content>
on a default.aspx page i've just scribbled some text to check the layout
but it bleeds right out of the center and into the right margin.
see attached image of how it displays.
Attached Images
Last edited by ZeBula8; Nov 29th, 2007 at 08:54 PM .
Reason: resolved
Nov 29th, 2007, 12:36 AM
#2
Re: CSS and MasterPage-style not showing in pages
Try adding a / to the front of the path to the css file
<link href="/App_Themes........
master pages don't exist on the client, it's the path to the page thats the url
Nov 29th, 2007, 11:07 AM
#3
Thread Starter
Fanatic Member
Re: CSS and MasterPage-style not showing in pages
I did that but the page still isn't behaving properly.
Nov 29th, 2007, 11:49 AM
#4
Re: CSS and MasterPage-style not showing in pages
You have long lines of text which contain no breaks, so basically it is one long word. If the width of a "word" is greater than the width of its container it overflows the container boundaries. Wrapping does not happen in the "middle" of a word.
Nov 29th, 2007, 08:52 PM
#5
Thread Starter
Fanatic Member
Re: CSS and MasterPage-style not showing in pages
i also tried using sentences consisting of five words each, and the same thing happens.
i have figured out what was happening.. the image width was causing this problem. as soon as i adjusted the content to match the image width, the wrapping was correctly being rendered in the contentplaceholder... even with the long text with no breaks.
thanks everyone for your help.
Last edited by ZeBula8; Nov 29th, 2007 at 08:53 PM .
Reason: [resolved]
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width