Jump to content
  • 0

Проблема с версткой


assd18
 Share

Question

Всем здравствуйте!У меня есть окно, в нем картинка. Нежно чтобы при изменении окна менялся размер картинки. При пропорциональном увеличении работает, а если сделать высоту намного меньше чем ширину то вылазит за рамки. Работать должно только в ie от 7. Всем заранее спасибо)

Вот код:

CSS

* {

margin: 0;

padding: 0;

}

html {

height: 100%;

}

body {

position: relative;

font: 12px/18px Arial, Tahoma, Verdana, sans-serif;

width: 100%;

height: 100%;

}

a {

color: blue;

outline: none;

text-decoration: underline;

}

a:hover {

text-decoration: none;

}

p {

margin: 0 0 18px

}

img {

border: none;

}

input {

vertical-align: middle;

}

.parent {

border: 1px solid #4080FF;

border-radius: 5px;

padding: 7px;

width: 460px;

height: 300px;

}

.child,

.helper {

display: -moz-inline-block;

display: inline-block;

vertical-align: middle;

}

.child {

position:relative;

display:block;

width:100%;

}

.child img {

position:relative;

display:block;

min-height:1%;

max-height: 90%;

max-width: 100%;

width: auto;

height: auto;

margin:0 auto;

}

.helper {

width: 0;

height: 100%;

}

#footer {

margin-top:-10px;

height:100%;

width:100%;

}

#text{

align:center;

color: #4080FF;

font:10px "Times New Roman",Georgia,Serif;

}

HTML

<html>

<head>

<link href="CSS/style_1.css" rel="stylesheet" type="text/css"/>

<title>Image watch</title>

<!--[if lte IE 7]>

<style type="text/css">

.child,

.helper {

zoom: 1;

display: inline;

}

</style>

<![endif]-->

</head>

<body>

<div class="parent">

<div class="child">

<img alt="" src="img/1.jpg">

</div>

<div class="helper"></div>

<div id="footer">

<div id="text" align="center">Press <strong>SPACE</strong> for full screen and more options</div>

</div>

</div>

</body>

</html>

Edited by assd18
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy