Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Gap Above Header?

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 937 Views
  • poonk
    Avatar
    Community Member
    7 Posts

    Gap Above Header? Link to this post

    Hi,

    I modded the standard blackcandy theme and if I look at the html page in a browser it looks fine with 0 top margin and header flush with the top of the browser, but when in silverstripe I get around a 20px gap above my header.

    For some reason I had this happen to me trying to make a wordpress theme also, does anyone know anything in particular to stop this happening, it seems to be something that php powered sites seem to do to css or something, it is obvious that lots of people know how to avoid this, it seems so obvious to a lot of people that it is hard to find information on such a thing when googling. Either knowingly or unknowingly theme designers seem to put in a preventive measure to stop this from happening, what that measure is I would Love to know

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Gap Above Header? Link to this post

    I have no idea without seeing any code.

    The only thing I can think of is that SS renders the template with their own xhtml doc type. View source on the rendered SS page to see.

    The html template you have coded might be in a different mode, and when it is being displayed with SS, there are slight differences.

    Add this line in your config file to disable it - ContentNegotiator::disable();

    Not sure if that's it, but only thing to guess without seeing code.

  • poonk
    Avatar
    Community Member
    7 Posts

    Re: Gap Above Header? Link to this post

    Thankyou for the help LeeUmm

    I tried putting ContentNegotiator::disable(); into the config file as you recommended

    It did change the source doc type from
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    to the orginal

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" >

    But unfortunately the gap above the header still remained

    I will keep on redesigning stuff until hopefully something works (Will update how things go)

    Cheers from Josh

    937 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.