Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 22nd, 2006, 05:22 PM
Authorized User
Join Date: Feb 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default CSS formatting


I am experiencing some problems when experimenting with formatting via a CSS.

I have a table element:

<table class="Table_Small" style="position: relative">
  <tr >
    <td >
        <asp:Label ID="Label4" runat="server" Style="position: relative" Text="First Name"></asp:Label><br />
        <asp:TextBox ID="txtFirstName" runat="server" Style="position: relative"></asp:TextBox>

Here is the corresponding CSS (StyleSheet.css) entry:


    LEFT: 0px;
    WIDTH: 550px;
    COLOR: Black;
    POSITION: relative;
    TOP: 0px;
    font-size: small;
    text-align: left;
    left: 0px;
    position: relative;
        top: 0px;

I have the following in the MasterPage.aspx:
<link rel="stylesheet" type="text/css" href="StyleSheet.css" />

The CSS formatting is applied when I switch to design view. However, when I open the page in my browser, the formatting is not applied. For example, I have a few textboxes in the table cells. In design view, they are aligned at the left side of the table cells, but in the browser, they are centered in the table cells. Also, even though I have specified a background color of white for the table, when I run the project, the background is blue, which is the background color of my master page.

I have not specified any formatting for the table rows or cells.

Can anyone explain to me why this approach will not work?


  #2 (permalink)  
Old March 23rd, 2006, 01:04 PM
Wrox Author
Join Date: Jun 2004
Location: Liskeard, Cornwall, United Kingdom.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Mike,
         I think it's not finding your style sheet. Where is your style sheet with regards to a) your master and b) the page with the code in?


Chris Ullman
Programmer/Technical Author
  #3 (permalink)  
Old March 24th, 2006, 10:55 AM
Authorized User
Join Date: Feb 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Chris,

The stylesheet is in the root directory of the project, as is the master page. The content page with the table is in a sub-directory of a folder that is itself a sub-directory of the project folder.

To make it clearer, here is the file layout:

-WebApplication1 (main project directory)
  -UserPages (sub-directory)
    -DirectorPages (sub-directory)
      -TableTestCSS.aspx (content page w/ table)


  #4 (permalink)  
Old April 10th, 2006, 09:16 AM
Registered User
Join Date: Apr 2006
Location: , , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Not sure if you've fixed the problem as the last post was a while ago but i have a suggestion.
In your CSS file, are the different elements in the order that they are called upon on the master page?

e.g on the master page:
div class="header" above
div class="footer".
and in the css file
div.header{ above

I had this problem and it was fixed by ensuring the above rule was followed. Still catches me out though :)
Hope this helps.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Css formatting problem beetle_jaipur CSS Cascading Style Sheets 2 June 5th, 2009 07:16 AM
CSS HELP:! CSS EXPANDIBLE BACKGROUND FOR TITLE phpuser2000 CSS Cascading Style Sheets 2 December 19th, 2007 12:36 AM
Rich's new CSS book: Beginning CSS 2nd Edition jminatel BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 0 June 15th, 2007 11:55 AM
Formatting php with css Hylsan Pro PHP 3 December 25th, 2006 07:16 AM
Formatting syrex XSLT 2 November 5th, 2005 08:23 AM

All times are GMT -4. The time now is 11:27 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.