Something related to CSS

asp.net , css , xhtml Chicoutimi-Jonquière, Canada
  • 9 years ago

    hi all,

    I have a tag topdision in my css file :

    .topdivision

    {

    width:100%;

    height:100px;

    background-image:url(images/banner5.jpg);background-repeat:no-repeat;

    }

    but when I use it like:

    <div id="division" class="topdivision"></div>

    it doesn't work nor it gives me any error. I have linked the CSS with my masterpage. But when I use the style property it works fine, like:

    <div id="division" style="height:100px; background-image:url(images/banner5.jpg)" runat="server"></div>

    Can you guide me in this regard.

    Regards,

    Royal

  • 9 years ago

    Weird!, it looks like it should work so I tested it on one of my master pages and it works fine. I can access it on the masterpage and on all the content pages. Are you sure your link to the CSS is good? Wow, when you fine why it is not working could you post it here.

    Thanks

  • 9 years ago

    Hi,

    Just try Cssclass instead of class in this Line

    <div id="division" class="topdivision"></div>

     Hope it works...

  • 9 years ago

    hi Saravanan,

    There is no such property called CssClass for <Div> tag.

    Regards,

    Royal

  • 9 years ago

    hi Freon,

    The link I use is:

    <link href="App_Themes/rainy/rainy.css" rel="stylesheet" type="text/css" />

     I tried few things but it doesn't work. As u said your code worked, can you paste your code here so that i can look into and may be there might be some minute mistake I might be doing.

    Regards,

    Royal

  • 9 years ago
    I see you are keeping your style sheet in the App_Themes folder. Are you using theme controls, also does any of your other styles from the style sheet work on the page?  If your masterpage is not in the root directory but is in a sub directory then your link should look like

     

    <link href="../App_Themes/rainy/rainy.css" rel="stylesheet" type="text/css" />

     

    <%@ Master Language="VB" CodeFile="SectorMasterPage.master.vb" Inherits="SectorMasterPage" EnableTheming="true" %>

    <!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 runat="server">

     

    <link href="../App_Themes/default/default.css" rel="stylesheet" type="text/css" />

     

     my style sheet

    .topdivision

    {

    width:100%;

    height:100px;

    background-image: url("images/05 textiles.gif");

    background-repeat:no-repeat;

    }

    From my content page.

    <asp:Content ID="Content9" ContentPlaceHolderID="ContentPlaceHolder9" runat="server">

    <div class="topdivision"></div>

     

    </asp:Content>

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Brevity is the soul of wit” - Shakespeare