Try Now
More in this section

Forums / Designing with Sitefinity / Why Wrap in Divs if Placeholders have IDs?

Why Wrap in Divs if Placeholders have IDs?

3 posts, 0 answered
  1. mark
    mark avatar
    22 posts
    05 Sep 2008
    05 Sep 2008
    Link to this post
    Im going through the master page /skin / theme tutorals (which are way too complex IMHO) and im just wondering if i need to have div placeholders if the asp placeholders create divs? it just seems unneccusary to have

    <div id="MainBody">
    <asp:contentplaceholder id="UpperBody" runat="server"/>

    when just

    <asp:contentplaceholder id="UpperBody" runat="server"/>

    would do and i coukld style that?

    also is the a primer for each module as i'd like to style it all from the top in a single file rather than have to go through each block and edit bits of code everywhere?

  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    18 Jul 2012
    06 Sep 2008
    Link to this post
    as far as I know the asp.net placeholder controls do not create divs, they merely replace themselves with the content from the derived pages which populate them. So if you wish to have a contentplaceholder hold content that needs to be wrapped globally in a specific div, then you would wrap that placeholder in a div.

    regarding each module, while it is necessary for you to style each indidivual control (such as the newsview, blogview, etc) they are all derived from the same generic content module, so once you style one the process is similar to style the remaining ones. Additionally, you could simply go into each control and apply your own custom styling (div tags, css classes etc). each module has its associated control template in the /sitefinity/controltemplates/<module> folder.

    hope this was helpful!
  3. Georgi
    Georgi avatar
    3583 posts
    10 Oct 2016
    08 Sep 2008
    Link to this post
    Hello Mark,

    In addition to Josh's answer, ContentPlaceholders do not support the Height and Width attributes. So wrapping in <divs> or in other content blocks will allow you to define styles and frames for your objects in a clear way.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
3 posts, 0 answered