Change Div Size |
Change Div Size |
FrostTaco |
Apr 29 2016, 03:27 PM
Post
#1
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
Hi guys, I'm new to css, so here we go. I need to change the height of a div to about 120px, but well, it does nothing, the input part works, just not the div part:
CODE <style type="text/css"> .zoomin input { border-radius: 10px; border: 2px solid gray; height: 100px; width: 100px; -webkit-transition: all 2s ease; -moz-transition: all 2s ease; -ms-transition: all 2s ease; transition: all 2s ease; } .zoomin input:hover { width: 150px; height: 150px; } .zoomin div { height: 120px; } </style> |
pandy |
Apr 29 2016, 03:50 PM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Should work. How does the HTML look?
|
FrostTaco |
Apr 29 2016, 03:53 PM
Post
#3
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
Should work. How does the HTML look? <div class="zoomin"> <input type="image" src="images/giveaways/main/csgoitem.png" alt="Submit" onClick="parent.location='giveaway.php?id=lA3JC/csgopossibly-and-csgo-skins-giveawayunclaimed'" data-toggle="tooltip" title="CSGO Items(Possibly Game)"> </div> |
Christian J |
Apr 29 2016, 04:37 PM
Post
#4
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
This CSS:
CODE .zoomin div { height: 120px; } styles a DIV inside .zoomin, not .zoomin itself. |
FrostTaco |
Apr 29 2016, 04:49 PM
Post
#5
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
|
pandy |
Apr 29 2016, 05:07 PM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
The HTML isn't the problem. The CSS is. Christian explained what the selector you use matches. To match the DIV itself you just need this.
CODE .zoomin { ... } Read the below page. There are many more selectors than those described there, but the basic ones are there and that's enough to get you going. http://htmlhelp.com/reference/css/structure.html |
FrostTaco |
Apr 29 2016, 05:25 PM
Post
#7
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
The HTML isn't the problem. The CSS is. Christian explained what the selector you use matches. To match the DIV itself you just need this. CODE .zoomin { ... } Read the below page. There are many more selectors than those described there, but the basic ones are there and that's enough to get you going. http://htmlhelp.com/reference/css/structure.html Sorry if im not understanding correctly, but from what you said, and the link, shouldn't this work(nothing changed in the result)? CODE .zoomin input { border-radius: 10px; border: 2px solid gray; height: 100px; width: 100px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -ms-transition: all 1s ease; transition: all 1s ease; } .zoomin input:hover { width: 150px; height: 150px; } .zoomin { height: 120px; } |
pandy |
Apr 30 2016, 09:13 AM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Yes, and it does. Only as you have it you won't see any difference since the only thing in that DIV is the input. Of if you have something after it in the HTML, that will be pushed down. Give .zoomin a background color and you can see its height.
Or is it some other DIV you are talking about? .zoomin is the only one in the markup you posted. |
FrostTaco |
Apr 30 2016, 11:36 AM
Post
#9
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
Yes, and it does. Only as you have it you won't see any difference since the only thing in that DIV is the input. Of if you have something after it in the HTML, that will be pushed down. Give .zoomin a background color and you can see its height. Or is it some other DIV you are talking about? .zoomin is the only one in the markup you posted. I gave it a background color, and it takes up the entire empty space. Also, the only html I use it in right now is the one above. Thanks alot guys, but i found the problem! I had to add in display: inline; to the css code, again thanks alot This post has been edited by FrostTaco: Apr 30 2016, 11:55 AM |
pandy |
Apr 30 2016, 12:44 PM
Post
#10
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
|
FrostTaco |
Apr 30 2016, 02:45 PM
Post
#11
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
|
pandy |
May 1 2016, 10:21 AM
Post
#12
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Can you paste the complete document in here just as it is? I'm curious.
|
FrostTaco |
May 3 2016, 05:17 PM
Post
#13
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
Can you paste the complete document in here just as it is? I'm curious. yeah, and also, now, I changed one thing in the webpage, and now the pictures are to the left... CODE <!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>FrostyCSGO</title> <link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" type="text/css" href="css/mobile.css"> <script src="js/mobile.js" type="text/javascript"></script> <style type="text/css"> .zoomin input { border-radius: 10px; border: 2px solid gray; height: 100px; width: 100px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -ms-transition: all 1s ease; transition: all 1s ease; } .zoomin input:hover { width: 150px; height: 150px; } .zoomin { display: inline; height: 120px; } .bhtml { border-radius: 10px; border: 2px solid gray; color: red; background-color: orange; width: 100%; } .rpic { border-radius: 17px; border: 2px solid gray; } </style> </head> <body> <div id="page"> <div id="header"> <div> <a href="index.php" class="logo"><img src="images/frosty/frostycsgo.png" alt=""></a> <?php include "apikey.php"; include "openId.php"; $OpenID = new LightOpenID("corndog.corticalcafe.com"); session_start(); if(!$OpenID->mode){ if(isset($_GET['login'])){ $OpenID->identity = "http://steamcommunity.com/openid"; header("Location: {$OpenID->authUrl()}"); } if(!isset($_SESSION['FrostyTaco'])){ $login = "<div id=\"login\">Welcome FrostGuest, Please <a href=\"?login\"><img src=\"https://steamcommunity-a.akamaihd.net/public/images/signinthroughsteam/sits_large_border.png\"/></a></div>"; } } elseif (!$OpenID->mode == "cancel") { } else { if(!isset($_SESSION['FrostyTaco'])){ $_SESSION['FrostyTaco'] = $OpenID->validate() ? $OpenID->identity : null; $_SESSION['FrostyID64'] = str_replace("http://steamcommunity.com/openid/id", "", $_SESSION['FrostyTaco']); if($_SESSION['FrostyTaco'] !== null){ $steam64 = str_replace("http://steamcommunity.com/openid/id", "", $_SESSION['FrostyTaco']); $profile = file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=${api}&steamids={$steam64}"); $arr = array('email' => "", 'tradelink' => "", 'refer' => ""); if (!file_exists("cache/{$steam64}.json")){ $buffer = fopen("cache/{$steam64}.json", "w+"); $buffercustom = fopen("cache/{$steam64}custom.json", "w+"); fwrite($buffer, $profile); fwrite($buffercustom, json_encode($arr)); fclose($buffer); fclose($buffercustom); } } header("Location: index.php"); } } if(isset($_SESSION['FrostyTaco'])){ $steam64 = str_replace("http://steamcommunity.com/openid/id", "", $_SESSION['FrostyTaco']); $profile = file_get_contents("cache/{$steam64}.json"); $content = json_decode($profile, true); $_SESSION['steam_avatarmedium'] = $content['response']['players'][0]['avatarmedium']; $_SESSION['steam_name'] = $content['response']['players'][0]['personaname']; $_SESSION['steam_url'] = $content['response']['players'][0]['profileurl']; $avatar = $_SESSION['steam_avatarmedium']; $name = $_SESSION['steam_name']; $url = $_SESSION['steam_url']; echo "<a href='$url'><img src='$avatar' class='rpic'></a><a href='MyAccount.php' class='bhtml'>$name</a>"; $login = "<div id=\"login\"><a href=\"?logout\">Logout</a></div>"; } if(isset($_GET['logout'])){ unset($_SESSION['FrostyTaco']); unset($_SESSION['FrostyID64']); header("Location: index.php"); } // echo $login; ?> <ul id="navigation"> <li class="selected"> <a href="index.php">Home</a> </li> <li> <a href="contact.php">Contact</a> </li> <?php echo "$login" ?> </ul> </div> </div> <div id="body" class="home"> <div class="header" align="center"> <div class="zoomin"> <ul> <li> <input type="image" src="images/giveaways/main/MirrorMoonEP.jpg" alt="Submit" onClick="parent.location='giveaway.php?id=MGEw0/'" data-toggle="tooltip" title="Mirror Moon EP And Starwars"> </li> <li> <input type="image" src="images/giveaways/main/AvoidSensoryOverload.jpg" alt="Submit" onClick="parent.location='giveaway.php?id=UTkmH/'" data-toggle="tooltip" title="MirrorMoon EP, OutCast 1.1, Avoid Sensory Overload"> </li> </ul> </div> <?php if(isset($_SESSION['FrostyTaco'])){ $steam64 = str_replace("http://steamcommunity.com/openid/id", "", $_SESSION['FrostyTaco']); $profile = file_get_contents("cache/{$steam64}.json"); $_SESSION['steam_name'] = $content['response']['players'][0]['personaname']; $name = $_SESSION['steam_name']; echo "<h1><b>Welcome $name</b></h1>"; } else { echo "<h1><b>Welcome FrostGuest</b></h1>"; } ?> <h1>Click on a giveaway to be redirected to that giveaway</h1> <p>All images above are images of the acctual items being given away!</p> </div> <div class="body"> <div align="center"><p>Site owned by FrostTaco3</p></div> </div> <div class="footer"> <br /> <br /> <br /> <br /> <br /> <br /> </div> </div> <div id="footer"> <div align="center"> <p>FrostyCS:GO</p> <a href="http://steampowered.com">Powered by Steam</a> </div> </div> </div> </body> </html> |
pandy |
May 3 2016, 07:08 PM
Post
#14
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Oh. Seems the parts we are interested in are included, so that idea didn't work out.
|
FrostTaco |
May 3 2016, 07:16 PM
Post
#15
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
|
Christian J |
May 3 2016, 07:24 PM
Post
#16
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
View the page source from a browser and copy that into a forum post.
|
FrostTaco |
May 3 2016, 07:39 PM
Post
#17
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
View the page source from a browser and copy that into a forum post. CODE <!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>FrostyCSGO</title> <link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" type="text/css" href="css/mobile.css"> <script src="js/mobile.js" type="text/javascript"></script> <style type="text/css"> .zoomin input { border-radius: 10px; border: 2px solid gray; height: 100px; width: 100px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -ms-transition: all 1s ease; transition: all 1s ease; } .zoomin input:hover { width: 150px; height: 150px; } .zoomin { display: inline; height: 120px; } .bhtml { border-radius: 10px; border: 2px solid gray; color: red; background-color: orange; width: 100%; } .rpic { border-radius: 17px; border: 2px solid gray; } </style> </head> <body> <div id="page"> <div id="header"> <div> <a href="index.php" class="logo"><img src="images/frosty/frostycsgo.png" alt=""></a> <ul id="navigation"> <li class="selected"> <a href="index.php">Home</a> </li> <li> <a href="contact.php">Contact</a> </li> <div id="login">Welcome FrostGuest, Please <a href="?login"><img src="https://steamcommunity-a.akamaihd.net/public/images/signinthroughsteam/sits_large_border.png"/></a></div> </ul> </div> </div> <div id="body" class="home"> <div class="header" align="center"> <div class="zoomin"> <ul> <li> <input type="image" src="images/giveaways/main/MirrorMoonEP.jpg" alt="Submit" onClick="parent.location='giveaway.php?id=MGEw0/'" data-toggle="tooltip" title="Mirror Moon EP And Starwars"> </li> <li> <input type="image" src="images/giveaways/main/AvoidSensoryOverload.jpg" alt="Submit" onClick="parent.location='giveaway.php?id=UTkmH/'" data-toggle="tooltip" title="MirrorMoon EP, OutCast 1.1, Avoid Sensory Overload"> </li> </ul> </div> <h1><b>Welcome FrostGuest</b></h1> <h1>Click on a giveaway to be redirected to that giveaway</h1> <p>All images above are images of the acctual items being given away!</p> </div> <div class="body"> <div align="center"><p>Site owned by FrostTaco3</p></div> </div> <div class="footer"> <br /> <br /> <br /> <br /> <br /> <br /> </div> </div> <div id="footer"> <div align="center"> <p>FrostyCS:GO</p> <a href="http://steampowered.com">Powered by Steam</a> </div> </div> </div> </body> </html> |
pandy |
May 3 2016, 09:25 PM
Post
#18
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
.zoomin is still 120px if I take away the display: inline.
This isn't very similar to what you posted. Where did the box with the rounded corners go? |
FrostTaco |
May 4 2016, 03:15 PM
Post
#19
|
Member Group: Members Posts: 47 Joined: 26-April 16 Member No.: 24,193 |
.zoomin is still 120px if I take away the display: inline. This isn't very similar to what you posted. Where did the box with the rounded corners go? um... CODE .zoomin input { border-radius: 10px; border: 2px solid gray; height: 100px; width: 100px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -ms-transition: all 1s ease; transition: all 1s ease; } .zoomin input:hover { width: 150px; height: 150px; } .zoomin { display: inline; height: 120px; } border-radius: 10px; border: 2px solid gray; rounds the corners |
pandy |
May 4 2016, 05:25 PM
Post
#20
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
I see them now but they are itsy bitsy. The size doesn't take for some reason. But as sais, that DIV is the height you want it to be in the browsers I've checked in.
|
Lo-Fi Version | Time is now: 24th April 2024 - 08:29 PM |