17488 Posts in 4473 Topics by 1978 members
|Go to End|
12 November 2008 at 3:15am Last edited: 12 November 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
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.
12 November 2008 at 7:06pm Last edited: 12 November 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" 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
|Go to Top|