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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

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

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

Gap Above Header?

Go to End

3 Posts   1196 Views


Community Member, 7 Posts

12 November 2008 at 3:15am

Edited: 12/11/2008 3:20pm


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


Community Member, 470 Posts

12 November 2008 at 6:39am

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.


Community Member, 7 Posts

12 November 2008 at 7:06pm

Edited: 12/11/2008 7:08pm

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