Solved

How do I use css to find my panel's ID?

Posted on 2014-09-04
5
129 Views
Last Modified: 2014-09-04
If my HTML looks like this:

<%@ Page Title="" Language="C#" MasterPageFile="Site.master" AutoEventWireup="true"
    CodeFile="UARForm.aspx.cs" Inherits="UARForm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link type="text/css" rel="stylesheet" href="Styles/UARForm.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:Panel ID="pnlManager" runat="server">
    </asp:Panel>
    <asp:Panel ID="pnlHR" runat="server">
        <div class="divHR" id="divHR">
            <asp:Label ID="lblHRHeader" runat="server" Text="Approval Tracking:" />
        </div>
    </asp:Panel>
</asp:Content>

Open in new window


why does this:

#pnlHR
{
    margin: 20px 0 0 0;
}

 not work to add 20px to the top margin?
0
Comment
Question by:mikesExpertExchange
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40303976
Because you have runat=server on the element which will change the ID.
Add a class to the element and use that for the css targetting or remove the runat attribute
0
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 40304009
Thank you. Will do. Before I do that, what adverse affects will that have on my panel, that I need to be concerned about? Removing the "runat" attribute?
0
 
LVL 58

Expert Comment

by:Gary
ID: 40304026
Won't have any effect for a panel.
0
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 40304105
Thank you.
0
 
LVL 1

Author Closing Comment

by:mikesExpertExchange
ID: 40304106
Thanks for your input.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question