Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.


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

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

Gap Above Header?


3 Posts   945 Views


12 November 2008 at 3:15am (Last edited: 12 November 2008 3:20pm), Community Member, 7 Posts


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


12 November 2008 at 6:39am Community Member, 470 Posts

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.


12 November 2008 at 7:06pm (Last edited: 12 November 2008 7:08pm), Community Member, 7 Posts

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

to the orginal

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns="" xml: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