+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / Styles Not Being Applied

Styles Not Being Applied

4 posts, 0 answered
  1. Matthew Snyder
    Matthew Snyder avatar
    15 posts
    Registered:
    21 Sep 2009
    08 Oct 2009
    Link to this post
    I created a Sitefinity Template that is associated with a masterpage and a stylesheet. On the masterpage, there is a ContentPlaceHolder named LeftSidebar. I am adding a usercontrol (.ascx page) to LeftSidebar that has a link to its own separate stylesheet that is called at the top of the page:

    <link href="../../jQuery/css/redmond/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />

    This works fine. The stylesheet associated with the template is applied for the entire site, and the stylesheet i manually declared on the usercontrol is applied on itself.

    The problem is that if I drag a second usercontrol (even if it is the exact same one) to the LeftSidebar ContentPlaceholder, the style I linked above is only ever applied to the very first usercontrol - never any others. If I edit the page in SF and drag and drop the second control above the first control, it will gain the style linked above, and the control that was bumped down (that was previously styled appropriately) will lose its style.

    Using FireBug, I noticed that the styles are indeed not being applied to the tags of the second control in the LeftSidebar.

    Is there a way to apply my manually specified styles for all usercontrols in a ContentPlaceHolder?

    Please let me know if i can help to better explain this situation. Any advice is greatly appreciated.

    Thank you.
  2. Katia
    Katia avatar
    194 posts
    Registered:
    01 Jul 2016
    09 Oct 2009
    Link to this post
    Hello Matthew Snyder,

    If the HTML and CSS are the same and there are no wrapping elements with different CSS classes or IDs this should be working fine. The only thing I can think of at the moment is that a more specific rule is applied to the first control and it is not applied to the second one for some reason.

    Do you have your website live to see it in action? Or can you send your master page, control and theme (CSS) so we can set up a project locally and find out what is causing the issue.

    Greetings,
    Katia
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Matthew Snyder
    Matthew Snyder avatar
    15 posts
    Registered:
    21 Sep 2009
    12 Oct 2009
    Link to this post
    It ended up being an issue with css. For some reason, with jQuery, it seems like div id's need to be uniquely named when assigning controls to them. I had two controls with the same id on a page and somehow that was interfering with the css properties of the second control. Thanks.
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    14 Oct 2009
    Link to this post
    Hi Matthew Snyder,

    Thank you for the follow up. It's good to know that you managed to find the problem.
    Let us know if you have any other questions, and good luck with the project!

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered