Saturday, 15 March 2014

jquery - height and wiidth properties not working perfect -


I'm new in html5 and css.

I am trying to write a small web and I set the width and height of my element%

but when I set it: < Pre> #tmainImg img {text-align: center; Cushion Top: 2%; Width: 50%; Height: 56%; }

Height does not work, when I try to change "height" - deficiency or growth - nothing happens

But when I change the width, the height and width of the image change both ...

But when I set the height, then follow the pixel, this is the job. But I need a "responsive web design", so I do not want to use pixels. This is part of my CSS:

  img {border: 3px solid #fff; Boundary-radius: 0.3 m 0.3 m; Max-width: 100%; Maximum-height: 100%; Body {text-align: center; Width: 100%; Height: 100%; } # Email image {text-align: center; Cushion Top: 2%; Width: 50%; Height: 56%; }   

My question is how can I design height and width to follow the work properly?

I am a newbie, please help me ...

My english is bad, thanks for reading! : D

You need to set some CSS to div #tmainImg , You can change the width and height for img .

Demo

Try changing IMG width / height and see.

HTML
  & lt; Div id = "tmainImg" & gt; & Lt; Img src = "http://wallpaper-fullhd.com/wp-content/uploads/2013/03/at-the-beach-hd-wallpaper-1920x1200.jpg" & gt; & Lt; / Div & gt;   

css
  #tmainImg {float: left; Width: 100%; Height: 100%; Background: #dfdfdf; } # Optimum img {float: left; Text align: center; Cushion Top: 2%; Width: 50%; Height: 70%; }    

No comments:

Post a Comment