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.

Archive /

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

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

Gap Above Header?


Reply


3 Posts   967 Views

Avatar
poonk

Community Member, 7 Posts

12 November 2008 at 3:15am

Edited: 12/11/2008 3:20pm

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

Avatar
Liam

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.

Avatar
poonk

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
<!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" 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