Manipulando propriedades do CSS pelo Javascript

November 8, 2007 – 2:16 pm

Nessa semana nas minhas aulas um aluno me perguntou como fazer para alterar a cor de fundo de um campo de formulário.

Bom em CSS basta utilizar a propriedade background-color: cor; mas como fazer isso em javascript.

Então nas minhas buscas me deparei com uma relação de várias propriedades do CSS e como utilizar com javascript.

Abaixo segue a relação e espero que ajude assim como me ajudou.

Estou preparando uma série de posts com dicas de como utilizar as propriedades do CSS com javascript.

Propriedade - CSS Referência - JavaScript
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColor
border-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
clip clip
color color
cursor cursor
display display
filter filter
font font
font-family fontFamily
font-size fontSize
font-variant fontVariant
font-weight fontWeight
height height
left left
letter-spacing letterSpacing
line-height lineHeight
list-style listStyle
list-style-image listStyleImage
list-style-position listStylePosition
list-style-type listStyleType
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
overflow overflow
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
page-break-after pageBreakAfter
page-break-before pageBreakBefore
position position
float styleFloat
text-align textAlign
text-decoration textDecoration
text-decoration: blink textDecorationBlink
text-decoration: line-through textDecorationLineThrough
text-decoration: none textDecorationNone
text-decoration: overline textDecorationOverline
text-decoration: underline textDecorationUnderline
text-indent textIndent
text-transform textTransform
top top
vertical-align verticalAlign
visibility visibility
width width
z-index zIndex

Fonte: http://codepunk.hardwar.org.uk/css2js.htm

  1. 6 Responses to “Manipulando propriedades do CSS pelo Javascript”

  2. Favoritado aqui já! ;D

    By Julio on Jan 23, 2008

  3. Obrigado o pela visita e pelo comentário.

    By Hebertphp on Jan 24, 2008

  4. favoritado!!

    nota 10!

    By Bruno on Jun 16, 2008

  5. Deus lhe abençoe pelo post!

    By Mensagens Blog on May 23, 2010

  1. 2 Trackback(s)

  2. Nov 8, 2007: Mudar a cor de fundo de um campo de formulário - Javascript, CSS
  3. Mar 10, 2008: Portal Tecnologia » Blog Archive » Manipulação de propriedades CSS via JavaScript

Post a Comment



Artware: Desenvolvimento de sites - Divulgação de Sites