Bootstrap ejemplo barra de navegación anormal en mi máquina

I copied exactly the same code from official example

But on my machine something add 20px more to the space between navbar and content. I uploaded the pic.

enter image description here

Traté de cambiarlo a body { padding-top:40px; } and it's ok on pc, but the 20px appears again on mobile. So I cannot find out why. Please help me with that.

Edit: you can see my page on


Some editor on Windows will add BOM to the start of file. It's invisible and used to notice the editor that it is utf-8 encoded.

Para más detalles de BOM, consulte nuestra página, Byte Order Mark(wiki)

In notepad++, you can use Encoding -> Encode in utf-8 without BOM.

preguntado el 24 de agosto de 12 a las 10:08

Can you post a link to your page so we can compare? -

@DaveR I deployed it to thx. -

1 Respuestas

Okay - I've worked out the problem. You have a line of whitespace before your <!DOCTYPE html> declaration. If you delete this line and move <!DOCTYPE html> to line 1, you'll be working fine!

I've managed to recreate the problem here:

Version with whitespace (

Version without whitespace (

Respondido 24 ago 12, 10:08

I don't have that line now on But still not fixed. The " " below body still there - hbrls

There is still one space! You need to have absolutely no characters before the doctype. - DaveR

where did you see the space. in chrome view source? - hbrls

what are you using to prepare your html files? because it seems there is some weird encoding stuff going on behind the scenes. - DaveR

Oh man . . . I'm running out of suggestions! - try downloading this from pastebin rename the file extension to .html and upload to your server! - DaveR

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.