← Desenvolvimento

Top Bar - Width 100%

Lida 2538 vezes

Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Boas.

Tou com um problema..

Quero fazer uma topbar que fique com um comprimento de 100% (Como o site da Trignosfera, por exemplo)


Estou a usar um código inline porque não uso CSS... O código é:
Citar
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#C0C0C0" width="100%" >
         



            <tbody>
    <tr>

               <td height="50" background="novo/imagens/bg_bar.PNG"> hfhgfh<br></td>
 
            </tr>
</table>

Mas ele fica com umas bordas de lado. Não fica mesmo 100%!

Alguma solução?
Offline

Warrior 
Membro
Mensagens 203 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Olá Thomato,

No CSS onde tens "body", coloca:

Código: [Seleccione]
margin:0px;
Caso querias utilizar com DIV em vez de tabela, sempre podes colocar:

Código: [Seleccione]
<div style="background: url(novo/imagens/bg_bar.PNG) left repeat-x;">hfhgfh</div>
Se quiseres com aquela borda que tens na tabela:

Código: [Seleccione]
<div style="background: url(novo/imagens/bg_bar.PNG) left repeat-x; border:1px solid #C0C0C0">hfhgfh</div>
Para ambos os exemplos, coloca no CSS no body o "margin:0px;"
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2


Boas. Usei o código assim e não deu:

Código: [Seleccione]
<div style="background: url(novo/imagens/bg_bar.PNG) left repeat-x; margin:0px;">hfhgfh</div>
Offline

André Freitas 
Membro
Mensagens 941 Gostos 16
Troféus totais: 29
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Boas,

Não funciona pois estás a atribuir o valor 0px à propriedade margin à DIV.

Na tag body tem de estar assim:
<body style="margin:0px;">


Assim já não fica aquelas margens.

Corrijam-me se o meu raciocínio está errado.

Cumprimentos,
André Freitas.
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Boas.

Eu sou assim um bocado muito burro quando não percebo as coisas à primeira..

Citar
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#C0C0C0" width="100%" >

    <tr>

               <td height="50" background="novo/imagens/bg_bar.PNG"> hfhgfh<br></td>
 
            </tr>

</table>

Nesse código onde é que aplico a tag Body?

Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Já não é preciso!

Citar
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#C0C0C0" width="100%" >
<body style="margin:0px;">

    <tr>

               <td height="50" background="novo/imagens/bg_bar.PNG"> hfhgfh<br></td>
 
            </tr>
</body>
</table>

O Pedro Correia da 13Studio resolveu-me o problema ;) Obrigado a todos pela atenção e paciência para com um burro como eu...