Can't make border-radius on DT - html

Why can't I make a border-radius on my <dt>?
http://thistedbolig.konggulerodhosting.dk/
What can I change? I really need to make the border-radius. I have tried many things, but none of them work. I hope someone here can help me so I can finish the project.
CSS:
.dropdown dt { border-radius: 10px 0px 0px 10px;}
HTML:
<div class="small-6 medium-3 columns">
<dl class="dropdown">
<dt>
<a href="#0">
<span title="city" class="hida " ><img src="assets/images/search/placeholder.svg" alt="" style="width:20px; height:20px; margin-right:10px;">Vælg en by</span>
<p class="multiSel"></p>
</a>
</dt>
<dd>
<div class="mutliSelect">
<ul>
<li>
<input type="checkbox" value="Thisted" />Thisted</li>
<li>
<input type="checkbox" value="Snested" />Snested</li>
<li>
<input type="checkbox" value="Vesløs" />Vesløs</li>
<li>
<input type="checkbox" value="Nors" />Nors</li>
<li>
<input type="checkbox" value="Sennels" />Sennels</li>
<li>
<input type="checkbox" value="Østerild" />Østerild</li>
</ul>
</div>
</dd>
</dl>
</div>

You need to set the border on the a tag in order to apply a border
Thus:
Update:
.dropdown dt {
height: 20px;
line-height: 20px;
display: block;
background: black;
}
.dropdown dt a {
padding: 8px 20px 5px 10px;
overflow: hidden;
border-radius: 10px 0px 0px 10px;
}
should work!
line-height will center the text vertically!
Check this jsfiddle: https://jsfiddle.net/9tgj0n5k/1/

Related

How to show more information, when user hovers?

I have an info icon which when the user hovers over, is able to see more information. The icons are pngs and I DO NOT want to change the position of the image, so is there any idea about using tooltips with images in my case? I also would like the tooltip to look like this:
Example Tooltip
This is my HTML:
<div class="modeHolder">
<div class="toggle">
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</div>
<div class="mode">
<p>Ipad Mode</p>
</div>
<div class="infoIcon">
<img src="images/info.png" alt="info icon">
</div>
<div class="settings">
<img src="images/settings.png" alt="settings icon">
</div>
</div>
<div class="modeHolder">
<div class="toggle">
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</div>
<div class="mode">
<p>Mac Mode</p>
</div>
<div class="infoIcon">
</div>
<div class="settings"></div>
</div>
</div>
Thank you in advance
Codepen: https://codepen.io/D4SH13/pen/jOmOWqb
1st: Using Title tag in <img> element.
<div class="infoIcon">
<a href="#">
<img title="Extra Info" src="https://cdn.onlinewebfonts.com/svg/img_151567.png" alt="info icon" />
</a>
</div>
Final Code
Code Pen: https://codepen.io/gautam25raj/pen/poPoeNy
2nd: Using <span> element.
Take a <span> element and put it inside your tootltip container.
<div class="infoIcon">
<!-- New span element -->
<span class="extraInfo">Extra Info</span>
</div>
Make the <span> postion: absolute relative to your tooltip container position: relative and add some styles to <span> element.
.infoIcon {
position: relative;
}
.extraInfo {
position: absolute;
color: #fff;
background-color: #000;
border-radius: 5px;
padding: 2px 5px;
width: 70px;
text-align: center;
}
Now, change the visibility of the span element. So that it can stay hidden until the tooltip is hovered.
visibility: hidden;
i.e.
.extraInfo{
position: absolute;
color: #fff;
background-color: #000;
border-radius: 5px;
padding: 2px 5px;
width: 70px;
text-align: center;
visibility: hidden;
}
Now, when your tooltip is hover make the span element visible.
.infoIcon:hover .extraInfo {
visibility: visible;
}
Final Code
Code Pen: https://codepen.io/gautam25raj/pen/xxdxgrO
Hope this solves your problem

Can't seem to get two elements to be side-by-side

Here is what my webpage looks like:
As I highlighted in the picture, I'm trying to move the balance element to the right side.
I am trying to use the display:inline-block tag to do this.
Here is my CSS and HTML... what am I doing wrong?
CSS:
/* Game box */
.gamebox{
height: auto;
margin: 20px;
padding: 20px;
width: 50%;
font-family: "smooth";
background-color: white;
color: black;
box-shadow: 4px 4px lightgray;
display:inline-block;
}
/* Balance box */
.balance{
height: auto;
margin: 20px;
padding: 20px;
width: 50%;
font-family: "smooth";
background-color: white;
color: black;
box-shadow: 4px 4px lightgray;
display:inline-block;
}
HTML:
<body>
<div class="noselection">
<ul class="topnav">
<li><a class="active" href="#home"><i class="fa fa-rocket" aria-hidden="true"></i> Play</a></li>
<li><i class="fa fa-btc" aria-hidden="true"></i> Deposit</li>
<li><i class="fa fa-btc" aria-hidden="true"></i> Withdraw</li>
<li><i class="fa fa-university" aria-hidden="true"></i>Faucet</li>
<li><i class="fa fa-life-ring" aria-hidden="true"></i>Help & Support</li>
<?php echo $accountButton; ?>
<li class='right' id="top-balance"><a href=''></a></li>
</ul>
<div class="gamebox">
<h1><i class="fa fa-btc" aria-hidden="true"></i>itcoin dice game</h1>
<div class="error" id="error">You don't have anymore bitcoins left. Why not deposit some more?</div>
<form id="index">
Bet
<br>
<span>
<input id="userbet" onkeyup="checkBet()" value="100" type="text" name="bet" autocomplete="off">
<span id="beterror" class="errortext">That bet is not a valid bet.</span>
<span id="x2" class="timestwo" onclick="doubleBet()">x2</span>
<span id="/2" class="dividetwo" onclick="divideBet()">/2</span>
</span>
<br>
<span>
Chance<br>
<input id ="userchance" onkeydown="checkChance()" value="50" type="text" name="chance" autocomplete="off">
<span id="chanceerror" class="errortext">That is not a valid chance.</span>
</span>
<br>
<h3 id="payout">Payout: Loading...</h3>
<script>var username = <?php echo json_encode($_SESSION['username']); ?>;</script>
<script>var hash = <?php echo json_encode($_SESSION['hash']); ?>;</script>
<button type="button" id="dicebutton" onclick="prepareRoll(username, hash);" style="vertical-align:middle"><img src="Images/dice.png"> Roll dice!</button>
</form>
<button type="button" id="autobet" onclick="setAutoBet(true)"><i class="fa fa-rocket" aria-hidden="true"></i> Autobet</button>
<div class="autobet-mode" id="autobet-mode">
<h3 id="auto-bet-start-text">Please set your auto bet settings, then click 'Start rolling'!".</h3>
<button type="button" id="start-autobet" onclick="startAutoBet()">Start rolling!</button>
</div>
</div>
<div class="balance">
<h3 id="balance">Balance: Loading...</h3>
</div>
</div>
<?php echo $script; ?>
</body>
UPDATE:
Reducing the .balance width to 40% fixed the issue, but how can I now force it up?
Try this code
add box-sizing: border-box; property to both the classes.
CSS
.gamebox, .balance{
box-sizing: border-box;
}
hope this helps..
you are looking for below structure,
what happens here is when you apply fixed width to div and them apply padding and margin so your element width gets increased
so better you create another child container and assign padding margin over there
.gamebox, .balance{
width: 50%;
float: left;
height: 100px;
}
.gamebox-inner, .balance-inner{
border: 1px solid red;
padding: 10px;
margin: 10px;
background-color: #ddd;
}
<div class="gamebox">
<div class="gamebox-inner">
a
</div>
</div>
<div class="balance">
<div class="balance-inner">
b
</div>
</div>
You can try flexbox as follows.
<div id="container">
<div class ="first">first</div>
<div class="second">second</div>
</div>
#container {
width: 200px;
height: 300px;enter code here
border: 1px solid black;
backgroud-color:red;
display:flex;
}
.first {
background-color:blue;
width:50px;
height:50px;
flex:1;
}
.second {
background-color:green;
width:50px;
height:50px;
flex:2;
}

How to add this right beside image?

.item_one_image {
border: 1px solid #ccc;
width: 160px;
padding: 4px 0px 10px 14px;
height: 250px;
}
<div class="article">
<div id="title_1">
</div>
<div class="item_one_image">
<img src="#" />
</div>
<div class="description_box_1">
<div class="price_1">
<span>PRICE:</span>
</div>
<li class="description_os">
<ul>OS</ul>
</li>
<li class="descrption_ram">
<ul>RAM</ul>
</li>
<li class="descrption_storage">
<ul>STORAGE</ul>
</li>
</div>
</div>
I want to add price,OS,RAM right beside phone image.
Here is my image:demo-one
I have tried:
float:right;
margin:
with float property im able to move it to right side but with margin im not able to move it up and left.
Even if i manage to move it to right beside image,it breaks on smaller sized devices.
.item_one_image {
border: 1px solid #ccc;
width: 160px;
padding: 4px 0px 10px 14px;
height: 250px;
float:left;
}
.description_box_1{
float:left;
margin-left:25px;
}
ul{
margin:0;
}
<div class="article">
<div id="title_1">
</div>
<div class="item_one_image">
<img src="#" />
</div>
<div class="description_box_1">
<div class="price_1">
<span>PRICE:</span>
</div>
<ul>
<li class="description_os">
OS
</li>
<li class="description_ram">
Ram
</li>
<li class="description_storage">
Storage
</li>
</ul>
</div>
</div>
You have put ul in li , which is wrong.
ul is a parent of li , so li must be in ul.
Is this the same that you want?
Hope this helps.
To keep the image and text on 1 line, here is 2 good solutions that does, even on smaller devices.
Note, since an ul need a li, I removed your inner ul's
First, the most classical one, using BFC float on the image and a margin-left on the text.
This avoid issues like white spaces with inline block and width calculation when using float, or inline-block, on both elements.
.item_one_image {
border: 1px solid #ccc;
width: 160px;
padding: 4px 0px 10px 14px;
height: 250px;
float: left;
}
.description_box_1 {
margin-left: 176px; /* 160px width + 14px padding + 1px + 1px border */
}
<div class="article">
<div id="title_1">
</div>
<div class="item_one_image">
<img src="http://lorempixel.com/160/250/technics/7/" />
</div>
<div class="description_box_1">
<div class="price_1">
<span>PRICE:</span>
</div>
<ul>
<li class="description_os">
OS
</li>
<li class="descrption_ram">
RAM
</li>
<li class="descrption_storage">
STORAGE
</li>
</ul>
</div>
</div>
Second, a more modern solution, using Flexbox
.article {
display: flex;
}
.item_one_image {
border: 1px solid #ccc;
padding: 4px 0px 10px 14px;
}
.description_box_1 {
flex: 1; /* take all the remaining space */
}
<div class="article">
<div id="title_1">
</div>
<div class="item_one_image">
<img src="http://lorempixel.com/160/250/technics/7/" />
</div>
<div class="description_box_1">
<div class="price_1">
<span>PRICE:</span>
</div>
<ul>
<li class="description_os">
OS
</li>
<li class="descrption_ram">
RAM
</li>
<li class="descrption_storage">
STORAGE
</li>
</ul>
</div>
</div>
List item element of html tags should be covered by your unordered list element, that means, "ul" tag should have children elements as "li"
<div class="article">
<div id="title_1">
</div>
<div class="item_one_image">
<img src="#" />
</div>
<div class="description_box_1">
<div class="price_1">
<span>PRICE:</span>
</div>
<ul>
</ul>
<li class="description_os">
OS
</li>
<li class="descrption_ram">
RAM
</li>
<li class="descrption_storage">
STORAGE
</li>
</div>
</div>
.item_one_image {
border: 1px solid #ccc;
width: 160px;
padding: 4px 0px 10px 14px;
height: 250px;
float:left;
}
.description_box_1{
float:left;
margin-left: 10px;
}
https://fiddle.jshell.net/hofh146n/
Just add .item_one_image, .description_box_1 { float: left; } code in to your CSS. And change the ul,li structure. Refer code from following HTML section.
.item_one_image {
border: 1px solid #ccc;
width: 160px;
padding: 4px 0px 10px 14px;
height: 250px;
}
.item_one_image, .description_box_1 {
float: left;
}
<div class="article">
<div id="title_1">
</div>
<div class="item_one_image">
<img src="#" alt="demo image" />
</div>
<div class="description_box_1">
<div class="price_1">
<span>PRICE:</span>
</div>
<ul>
<li class="description_os"> OS </li>
<li class="descrption_ram"> RAM </li>
<li class="descrption_storage"> STORAGE </li>
</ul>
</div>
</div>

How to position the check box inside li element to center?

I have a list of items with a div content and a span with check box. I want to position my check box span to center of li element.
<li class="e-list e-state-default e-list-check">
<div class="cont-bg">
content here varies
</div>
<span >
<input class="e-lv-check e-checkbox e-js e-input" type="checkbox"/>
</span>
</li>
Content is loaded dynamically so its height and width varies. I couldn't set padding for positioning. Tried on positioning using vertical-align as well. Nothing worked.
.e-list.e-state-default {
background-color: #fff;
border-color: #c8c8c8;
}
.e-list {
border-bottom: 1px solid #c8c8c8;
font-size: 12px;
}
.cont-bg {
font-size: 17px;
height: 100px;
padding-left: 5px;
padding-top: 10px;
width: 80%;
display: inline-block;
}
.e-list .e-lv-checkdiv {
float: right;
}
.e-list {
border-bottom: 1px solid #c8c8c8;
font-size: 12px;
}
.e-list {
line-height: normal;
padding: 0 15px;
cursor: pointer;
vertical-align: middle;
}
<ul>
<li class="e-list e-state-default e-list-check">
<div class="cont-bg">
<div class="brooke">
</div>
<div class="listrightdiv">
<span class="templatetext">Brooke</span> <span class="designationstyle">HR Assistant</span>
<div class="aboutstyle">
Brooke provides administrative support to the HR office. Brooke provides administrative support to the HR office. Brooke provides administrative support to the HR office.
</div>
</div>
</div>
<span><input class="e-lv-check e-checkbox e-js e-input" type="checkbox" tabindex="" name="null" value="true" /> </span>
</li>
<li class="e-list e-state-default e-list-check">
<div class="cont-bg">
<div class="brooke">
</div>
<div class="listrightdiv">
<span class="templatetext">Brooke</span> <span class="designationstyle">HR Assistant</span>
<div class="aboutstyle">
Brooke provides administrative support to the HR office. Brooke provides administrative support to the HR office. Brooke provides administrative support to the HR office.
</div>
</div>
</div>
<span><input class="e-lv-check e-checkbox e-js e-input" type="checkbox" tabindex="" name="null" value="true" /> </span>
</li>
</ul>
Can any one help me?
Why are you mixing <div> and <span>? Having both in span will give you right results right? You can use something like this:
.e-list,
.e-list span {vertical-align: middle; text-align: center;}
<li class="e-list e-state-default e-list-check">
<span class="cont-bg">
content here varies
</span>
<span>
<input class="e-lv-check e-checkbox e-js e-input" type="checkbox"/> This is centered.
</span>
</li>
If for some reason, you cannot change your <div> to <span>, use:
.e-list {vertical-align: middle; text-align: center;}
.e-list div,
.e-list span {vertical-align: middle; text-align: center; display: inline-block;}
<li class="e-list e-state-default e-list-check">
<div class="cont-bg">
content here varies
</div>
<span>
<input class="e-lv-check e-checkbox e-js e-input" type="checkbox"/> This is centered.
</span>
</li>

Make horizontal 'li' the same height in CSS and HTML

I am trying to create ul with 2 lis, and they will be set horizontally. Here how it's looking right now:
As you can see the left's li height is less than the right one. I would like that the left one is same as the right one. Also I am using Bootstrap on this website. Here is my code:
<ul class="thumbnails <?php echo $pageLang; ?>">
<li class="span6" >
<div class="commentsArea">
<h3>dsfdsfd</h3>
<p></p>
</div>
</li>
<li class="span6 <?php echo $pageLang;?>">
<label>Name</label>
<input type="text" class="span6">
<label>Description:</label>
<textarea class="span6" rows="5" maxlength="450"></textarea>
<button class="btn btn-success" value="button">
</li>
</ul>
Relevant CSS:
.commentsArea {
background-color: #D4E7ED;
text-overflow: ellipsis;
-webkit-border-radius: 10px 5px 5px 10px;
border-radius: 10px 5px 5px 10px;
-moz-border-radius: 10px 5px 5px 10px;
padding: 5px;
}
I tried to set commentsArea height to 100%, but it didn't help. Also if I set the left li height "hard coded" (for example, height=228px) it works fine.
Is there a way to make (1) and (2) the same height?
If you can use a fixed height, add the below CSS
.thumnails li {
height: 228px;
}
Or whatever height is required.
I would recommend you not to use ul and li for such a markup. It's pretty easy to accomplish using divs. In fact it does not look like a proper usage of lists.
<div class="thumbnails thumbnails-cont">
<div class="span4 comments-cont">
<div class="commentsArea">
<h3>dsfdsfd</h3>
<p></p>
</div>
</div>
<div class="span4 offset4">
<label>Name</label>
<input type="text" class="span6">
<label>Description:</label>
<textarea class="span6" rows="5" maxlength="450"></textarea>
<button class="btn btn-success" value="button">Test</button>
</div>
</div>
CSS:
.thumbnails-cont {
position: relative;
}
.comments-cont {
position: absolute;
top: 0;
bottom: 0;
}
http://jsfiddle.net/n2VGS/