Estilizando o título da página

Postado por: Pedro Rogério em

Com as CSS é possível fazer alterações radicais no visual do nosso site. Você pode simplesmente fazer alterações em todo o seu site, ou apenas estar “estilizando” uma tag. Hoje vamos aprender a como efetuar alterações no título de nossa página. Para isso vamos usar a tag <h1>. Nosso código (x)HTML fica da seguinte forma:

<h1>Título da Página</h1>

Agora vamos mexer no nosso CSS, vamos definir o tipo de fonte:


<style type="text/css">
font-family:"Trebuchet MS", Helvetica, sans-serif;
</style>

Só que o nosso título não tem cor alguma, vamos agora definir uma cor para a fonte e também para o background:


<style type="text/css">
font-family:"Trebuchet MS", Helvetica, sans-serif;
color:#FFF;
background-color:#C63;
</style>

Vamos agora definir uma margem para o título para que o texto que venha a seguir não fique colado no mesmo:


<style type="text/css">
font-family:"Trebuchet MS", Helvetica, sans-serif;
color:#FFF;
background-color:#C63;
margin-bottom:5px;
</style>

Para uma melhor performance, vamos definir também o padding:


<style type="text/css">
font-family:"Trebuchet MS", Helvetica, sans-serif;
color:#FFF;
background-color:#C63;
margin-bottom:5px;
padding:15px;
</style>

Pronto, viu como é fácil, veja aqui um exemplo.

Posts Relacionados

Confira também outros artigos interessantes postados aqui no blog.

Gostou desse post?

Assine o nosso Feed RSS, siga-nos no Twitter, ou simplesmente nos recomende a seus amigos!

Sobre Pedro Rogério

Pedro Rogério é desenvolvedor web por paixão, não saberia fazer melhor outra coisa. Além de escrever para o Pinceladas da Web também escreve para o CSS no Lanche, blog voltado ao desenvolvimento front-end.

3 Responses to “Estilizando o título da página”

  1. Parece simples, mas muita gente ainda se perde na hora de estilizar títulos, é constante ver o uso de br para forçar uma margem.

    Abraços!!

  2. Estou fazendo esses tutoriais com esse intuito mesmo, ensinar quem está começando agora.

    Abraços!!!

  3. Juan Defoe disse:

    I am currently Trading in the Markets unfortunatly as a Mortgage Banker in the dark haven of (MBS) and FNMA Pooled Securities which is absolute profit hell and getting worse everyday. If I continue I will be forced to start pooling FHA and FNMA jumbo into Pool 3 which offers less profit potential than than even short T’s these days. Granted I do receive the YSP but with the inibility to trail options on the treasury these days most of the YSP gets destroyed before the pool can be sold so I need another avenue besides MBS and Shorting Financials which have come to an end this month. I am familiar with the concept of ETF’s but really have no idea how to trade them or what to look for in regards to profitability and pricing ceilings and and support floors or if these typical trading practices actually apply to ETFs. I read everything I can get my hands on in regards to the market but still have not had that AHA moment to give me the courage to get into the risky side of the markets other than the occasionally option. I would really like the opportunity to view these materials and see if at last I can have that AHA moment and make a career change out of the mortgage market without sacrificing my current income level.

Leave a Reply