Jump to content

Why is it making a staircase with the images and not allowing them to sit by each other


Jedijon

Recommended Posts

.dropbtn {
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    font-size: 16px;
    border: none;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f1f1f1;
    min-width: 800px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content img {
  width: 32px;
  height: 32px;
  margin: 3px;
  position: relative;
  float: left;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {background-color: #ddd;}

.dropdown:hover .dropdown-content {display: block;}

.dropdown:hover .dropbtn {background-color: #3e8e41;}

/* HIDE RADIO */
[type=radio] { 
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* IMAGE STYLES */
[type=radio] + img {
  cursor: pointer;
}

/* CHECKED STYLES */
[type=radio]:checked + img {
  outline: 2px solid #f00;
}
<div class="dropdown">
  <button class="dropbtn">Dropdown</button>
  <div class="dropdown-content">

<form name="form" action="icons-submit/submit_icon-default.php" method="post">
  <input type="radio" id="icon_default" name="icon_default"  value="icons/default.jpg" onchange='if(this.value != 0) { this.form.submit(); }'>
  <img src="icons/default.jpg">
<input type="text" id="id" name="id" value=" . $row['id'] . " style="background: transparent;border: none;font-size: 0;">
</form>

<form name="form" action="icons-submit/submit_icon-default.php" method="post">
  <input type="radio" id="icon_default" name="icon_default"  value="icons/default.jpg" onchange='if(this.value != 0) { this.form.submit(); }'>
  <img src="icons/default.jpg">
<input type="text" id="id" name="id" value=" . $row['id'] . " style="background: transparent;border: none;font-size: 0;">
</form>

<form name="form" action="icons-submit/submit_icon-Grass_Block.php" method="post">
<label>
  <input type="radio" id="icon_grass-block" name="icon_grass-block" value="icons/Grass_Block.png"onchange='if(this.value != 0) { this.form.submit(); }'>
  <img src="icons/Grass_Block.png">
</label>
<input type="text" id="id" name="id" value=" . $row['id'] . " style="background: transparent;border: none;font-size: 0;">
</form>
<form name="form" action="icons-submit/submit_icon-gear.php" method="post">
<label>
  <input type="radio" id="icon_gear" name="icon_gear" value="icons/Gear.png"onchange='if(this.value != 0) { this.form.submit(); }'>
  <img src="icons/Gear.png">
</label>
<input type="text" id="id" name="id" value=" . $row['id'] . " style="background: transparent;border: none;font-size: 0;">
</form>
  </div>
</div>

 

drop-down.png

Link to comment
Share on other sites

It'd be easier to tell by seeing the actual page but the problem is likely you floating elements.

Get rid of that on the <img>s and try this:

<div class="dropdown">
	<button class="dropbtn">Dropdown</button>
	<div class="dropdown-content">
		<form method="post">
			<button type="submit" formaction="icons-submit/submit_icon-default.php" name="icon_default[<?=$row['id']?>]" value="icons/default.jpg">
				<img src="icons/default.jpg">
			</button>

			<button type="submit" formaction="icons-submit/submit_icon-default.php" name="icon_default[<?=$row['id']?>]" value="icons/default.jpg">
				<img src="icons/default.jpg">
			</button>

			<button type="submit" formaction="icons-submit/submit_icon-Grass_Block.php" name="icon_grass-block[<?=$row['id']?>]" value="icons/Grass_Block.png">
				<img src="icons/Grass_Block.png">
			</button>

			<button type="submit" formaction="icons-submit/submit_icon-gear.php" name="icon_gear[<?=$row['id']?>]" value="icons/Gear.png">
				<img src="icons/Gear.png">
			</button>
		</form>
	</div>
</div>

I'm quite skeptical of those multiple PHP files you have there. What are they? They would need a minor adjustment to support the above markup.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.