-moz-barras de rolagem vertical equivalente para Chrome / Opera / Safari?
Pergunta
IE6, IE7 e IE8 exibe uma barra de rolagem vertical para a página por padrão, mesmo se não é de rolagem. Chrome e Firefox não fazer isso (estou assumindo Opera e Safari não fazer tão bem). Você pode fazer isso mesmo comportamento no FireFox usando o CSS:
body { overflow: -moz-scrollbars-vertical; }
Existe alguma maneira de forçar a barra de rolagem visível nas outras três navegadores? Ou melhor ainda, uma maneira padrão de fazê-lo?
Solução
Atualização
Você pode (além) necessidade de incluir -ms-overflow-y
e / ou -moz-scrollbars-vertical
, conforme mencionado em este outro StackOverflow pós :
html {
overflow: -moz-scrollbars-vertical; /* For FF */
-ms-overflow-y: scroll; /* For IE */
overflow-y: scroll; /* For others & old IE */
}
Original
html { overflow-y: scroll; }
Consulte "overflow-y" no W3Schools
Testado e verificado (com sucesso) em:
- FF 7
- Chrome 15
- IE + 5 + 6 7 + 8 + 9 + 10 (pré-visualização plataforma) w / IETester
- Opera 11.52
- Safari / Win 5.1.1
exemplo completa ??h2>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
html { overflow-y: scroll; }
</style>
</head>
<body>
Test content
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
html { overflow-y: scroll; }
</style>
</head>
<body>
Test content
</body>
</html>
Outras dicas
html { height: 100%; margin-bottom: 1px; }
Forçando barras de rolagem (agora ainda melhor) para mais informações.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow