Hyperlink text alignment not always correct in IE 10 - html

I have a very simple HTML table. Table cells have several hyperlinks. Here is an example table with a couple of hyperlinks:
<table cellspacing="0" class="list">
<tr><td style="width:40%"><span style="background-color:#D0D5E6"> </span><br />Text<br />(xx.xx.)</td><td><b>PCafe, Hämla:</b><br />Men 6 ot<br />Pel 32 ot</td><td>Seuraa livenä »</td></tr>
<tr><td style="width:40%"><span style="background-color:#D0D5E6"> </span><br />Text<br />(xx.xx.)</td><td><b>PCafe, Hämla:</b><br />Men 6 ot<br />Pel 32 ot</td><td>Seuraa livenä »</td></tr>
<tr><td style="width:40%"><span style="background-color:#D0D5E6"> </span><br />Text<br />(xx.xx.)</td><td><b>PCafe, Hämla:</b><br />Men 6 ot<br />Pel 32 ot</td><td>Seuraa livenä »</td></tr>
</table>
The problem is that when using IE 10, some of the hyperlink texts are aligned vertically, but not all of them. Some hyperlink texts are 1px below the center while some hyperlink texts are perfect, no problem.
Table rows can be identical, but still, one row has a hyperlink aligned OK and another row has a hyperlink which is not aligned OK. Even if these rows and hyperlinks are 100% identical. They have exactly the same HTML code, I mean.
I have noticed that the first table row has a hyperlink which is always OK. But after the first one, there are several table rows which have hyperlinks which texts are not centered vertically.
I do not know why IE 10 cannot center all hyperlinks vertically. My screen resolution is more than 1024 x 768 px.
And here is the CSS code:
body {
line-height: 18px;
text-align: left;
font-family: "Exo 2", Tahoma, sans-serif;
font-weight: 500;
font-size: 11px;
color: #000000;
}
.pnk {
box-sizing: content-box;
height: 18px;
vertical-align: middle;
text-align: center;
padding-left: 6px;
padding-right: 6px;
padding-top: 2px;
padding-bottom: 2px;
border: 1px solid #323B5A;
background-color: #323B5A;
font-family: "Exo 2", Tahoma, sans-serif;
font-weight: 400;
font-size: 11px;
color: #FFFFFF;
text-decoration: none;
line-height: 18px;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
#media screen and (min-width: 600px) {
.pnk {
padding-top: 2px;
padding-bottom: 2px;
}
}
#media screen and (min-width: 1050px) {
.pnk {
padding-top: 2px;
padding-bottom: 2px;
}
}
a.pnk {
color:#FFFFFF;
text-decoration: none;
font-weight:400;
display:inline-block;
}
table.list td {
padding-left: 10px;
padding-right: 5px;
padding-top: 5px;
padding-bottom: 5px;
text-align: left;
vertical-align: middle;
display: block;
box-sizing: border-box;
float: left;
}
#media screen and (min-width: 600px) {
table.list td {
padding-left: 10px;
padding-right: 5px;
padding-top: 0px;
padding-bottom: 0px;
border-bottom: 1px dotted #999999;
text-align: left;
vertical-align: middle;
display: table-cell;
box-sizing: content-box;
float: none;
}
}

Related

Text below button on the right

I want the text to be below the button on the right side, like so:
|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
| SOME BUTTON |
| |
|_______________________________________|
powered by Company
Tried everything with different divs etc, but can't get it too work.
.info_button{
border: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
background: #E50000;
color: #fff;
width: auto;
text-align: center;
padding: 10px 20px;
cursor: pointer;
/*margin-bottom: 20px;*/
margin-top: 10px;
font-size: 17px;
display: inline-block;
font-weight:330;
}
#media only screen
and (min-device-width : 375px)
and (max-device-width : 812px)
and (-webkit-device-pixel-ratio : 3)
{
.info_button
{
line-height:1.2;
}
}
<div style="text-align: center;"><a class="info_button" href="">Here is a button-text</a>
</div>
<div style="font-size: 10px; text-align: right; margin-bottom: 20px;">powered by companyname</div>
Probably this is really easy and I'm just lost.
Keep both on the same div
.info_button {
border: none;
border-radius: 5px;
background: #E50000;
color: #fff;
padding: 10px 20px;
cursor: pointer;
margin-top: 10px;
font-size: 17px;
display: inline-block;
font-weight: 330;
}
.box {
display:table; /* fit content */
margin:auto; /* center div */
text-align:right; /* push text to right */
}
<div class="box">
<a class="info_button" href="">Here is a button-text</a>
<div style="font-size: 10px; ">powered by companyname</div>
</div>

How to make mobile responsive height of a div with variable list items?

I have created an HTML widget that I intent to publish on all posts on my WordPress blog.
The widget is looking fine on the browser, But it is looking a little shaky on the mobile screen.
<div class="top-box">
<h3 id="box-heading">Our Verdict</h3>
<p id="box-text">Considering its price point and the features it offers, the Sennheiser GSP 300 is absolutely a great choice. It might not serve
like the top-notch gaming headsets (which are really expensive too), it will not leave you disappointed for sure. <br /><br />The headset is
comfortable, sounds great, good-built, and is compatible with most platforms. With little cons like a non-detachable mic and no surround sound,
it still beats some other beasts of a bit higher price points. The light-featured Sennheiser gaming headset is just right for action-packed
gaming without burning a hole in your pocket.</p>
<div class="Sub-box">
<div class="sub-box-left"><span class="dashicons dashicons-yes-alt"> For</span>
<ul id="sub-box-text">
<li>Lightweight & comfortable</li>
<li>Crystal clear mic</li>
<li>Great noise-cancelation</li>
<li>Large volume dial</li>
</ul>
</div>
<div class="sub-box-right"><span class="dashicons dashicons-dismiss"> Against</span>
<ul id="sub-box-text">
<li>Non-detachable microphone</li>
<li>No surround-sound</li>
<li>No chat-game audio balancer</li>
<li>Cable can be a mess for console players</li>
</ul>
</div>
</div>
<div class="review-amazon">
<div class="top-star">
<p id="rating-text">Not On Top Rating</p>
[yasr_overall_rating size="medium"]
</div>
<div class="check-price">
<p class="price-check">Check Price</p>
<a class="amazon-button" href="#">Check Price on Amazon</a>
</div>
</div>
</div>
css
.top-box {
background-color: #ededed;
padding-right: 20px;
padding-left: 20px;
padding-bottom: 25px;
overflow: auto;
}
#box-heading {
font-weight: 600;
font-size: 16px;
line-height: 20px;
text-transform: uppercase;
vertical-align: middle;
}
#box-text {
font-size: 14px;
line-height: 1.5em;
margin-bottom: 10px;
color: #333;
}
.sub-box-left {
float: left;
width: 50%;
padding-left: 15px;
border-right: 1px #fff dotted;
}
.sub-box-right {
float: right;
width: 50%;
padding-left: 15px;
}
#sub-box-text {
line-height: 1.5;
list-style: none;
margin-bottom: 1rem;
margin: 0;
padding: 0;
padding-top: 25px;
border: 0;
font: inherit;
font-size: 15px;
padding-bottom: 20px;
}
.dashicons.dashicons-yes-alt,
.dashicons.dashicons-dismiss {
width: 100%;
text-align: left;
color: black;
font-weight: 500;
font-size: 17px;
line-height: 40px;
text-transform: uppercase;
vertical-align: middle;
}
p:empty:before {
display: none;
}
#yasr-custom-text-before-overall {
display: none;
}
.top-star {
float: left;
width: 50%;
}
.check-price {
color: black;
width: 50%;
float: right;
text-align: center;
}
.price-check {
text-align: center;
}
#rating-text {
text-align: left;
}
a.amazon-button {
background-color: #5eaf16;
padding: 7px;
color: white;
white-space: nowrap;
}
.review-amazon {
padding-top: 20px;
}
.sub-box {
padding-bottom: 10px;
}
https://notontop.com/review/headphone/sennheiser-gsp-300/
This is the sample URL where I have added the code.
[yasr_overall_rating size="medium"] is a shortcode for showing star rating for every product.
Please open the window and try changing the screen size.
You'll have to add a media query within the css and make the items, full width / no float on mobile.
Something Like:
#media only screen and (max-width: 600px) {
.check-price, .top-star {
width: 100%;
float: none;
clear: both;
margin-bottom: 20px;
}
.top-star div, #rating-text {
text-align: center;
}
}
I am not sure how this will work in Wordpress but for a responsive webpage created with HTML5 and CSS, you will need a meta tag at the head of the HTML document: This is used along with Media Queries in the CSS which will make your page responsive to any device and size screen from the mobile, laptop and desktop. This is done with #media then the size screen of the device you need.

Getting nested divs inline and level with each other

Essentially I have several divs and I'm trying to align them so that they stay in line with each other regardless of the size of the window. I have a dropdown bar (testRegion) and I have a large textarea where users can input SSNS (SSNinput). Much of the rest of the page, on the righthand should be a table that displays the results.
I apologize, I don't have access to it at the moment, so I can't really show you how I'd like it to look, even with a screenshot. But essentially the height of testRegion, SSNinput, and the buttons below, should equal the height of the table on the righthand side. The table is being created successfully at the bottom of the code here. (maintbl).
<div class="pageContent row col-lg-12" style="white-space:nowrap; width:1200px;" >
<div class="col-lg-2" style="width: 245px; display:inline-block; white-space:nowrap;">
<div class="row" style="white-space:nowrap; display:inline-block; width:245px;">
<select class=" btn btn-default dropdown-toggle" id="testRegion" data-toggle="dropdown" style="width:235px">
<option value="a">Acceptance</option>
<option value="i">Integration</option>
</select>
</div>
<div class="row" style="padding-top: 8px; border: dotted; white-space:nowrap; width:245px;">
<textarea id="SSNinput" rows="21" class="form-control" placeholder="Paste/Import SSNS Here" style="width: 235px; display: inline-block;"></textarea>
</div>
<div id="navbuttons" style="float: left; white-space: nowrap; padding-top: 10px; width:245px;">
<button id="Validate" title="Validate" class="glyphicon glyphicon-play" onclick="getParticipantPlans();"></button>
<button id="Import" title="Import" class="glyphicon glyphicon-log-in"></button>
<button id="Export" title="Export" class="glyphicon glyphicon-log-out" onclick="ExportToExcel();"></button>
<button id="Clear" title="Clear" class="glyphicon glyphicon-repeat" onclick="ClearArea();"></button>
</div>
</div>
<div id='jqxWidget' class ="col-lg-8" style="font-size: 13px; font-family: Verdana; display: inline-block; width:800px; ">
<div id="maintbl"></div> <!--table created here successfully.-->
</div>
</div>
I'm sorry I can't provide a better description for you all. Essentially the behavior now, is that the SSNinput and testRegion divs get all out of whack and not level with the table. I've tried a bunch of container divs, and setting whitespace to nowrap. Nothing seems to work. Any guidance here would be appreciated. Thanks.
EDIT
Here's the attached CSS I'm using.
#nav {
padding-right: 10px;
resize: none;
max-width: 230px;
min-width: 230px;
float: left;
}
#thead {
color: white;
background-color: #0c98cf;
font-family: Arial;
width: 100%;
text-align: center;
border-radius: 10px;
}
#maintbl td {
text-align: center;
}
#title-wrapper {
background-color: #086387;
}
#import {
cursor: pointer;
font-size: 1.9em;
background-color: #0c98cf;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 6px;
padding-left: 12px;
color: white;
}
#clear {
cursor: pointer;
font-size: 1.9em;
background-color: #0c98cf;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 6px;
padding-left: 12px;
color: white;
text-align: center;
}
#export {
cursor: pointer;
font-size: 1.9em;
background-color: #0c98cf;
border-radius: 6px;
padding-left: 12px;
padding-top: 10px;
padding-bottom: 10px;
color: white;
}
#validate {
cursor: pointer;
font-size: 1.9em;
background-color: #0c98cf;
padding-top: 10px;
padding-bottom: 10px;
border-radius: 6px;
color: white;
}
#validate:hover {
color: white;
background-color: #808080;
}
#export:hover {
color: white;
background-color: #808080;
}
#import:hover {
color: white;
background-color: #808080;
}
#clear:hover {
color: white;
background-color: #808080;
}
#SSNinput {
resize: none;
border-radius: 0px;
overflow-y: auto;
display: inline-block;
border-radius: 9px;
}
/*drop area for importing in popup window*/
#drop {
border: 2px dashed #bbb;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding: 25px;
text-align: center;
font: 15pt bold, "Vollkorn";
color: #bbb;
}

How to add a background image on hover for a div with several elements

I'm having a box element with an icon (using font awesome icon "fa-video-icon") and text heading "Video Tutorial", here it is:
<a class="box" href="http://mylinkhere"><div class="heading-icon"><i class="fa fa-video-camera"></i></div>Video Tutorials</a>
What I want to achieve is when people hover the box to display a background-image instead of the box. The box should not appear, only the background-image.
.box {
border: 1px solid #ddd;
display: inline-block;
height: 170px;
line-height: 1.1;
margin-bottom: 20px;
margin-bottom: 2rem;
margin-right: 15px;
margin-right: 1.5rem;
padding: 10px;
padding: 1rem;
position: relative;
text-align: center;
vertical-align: top;
width: 155px;
font-size: 18px;
font-size: 1.2857143rem;
font-weight: 700;
color:#222;
}
.heading-icon {
font-size: 55px;
font-size: 4rem;
color:#8C0921;
margin-bottom: 1rem;
}
Appreciate your help!
The HTML:
<a class="box" href="http://mylinkhere">
<span class="heading-icon">
<i class="fa fa-video-camera"></i>
</span>Video Tutorials
</a>
The CSS:
.box {
display: inline-block;
height: 170px;
width: 155px;
border: 1px solid #ddd;
text-align: center;
padding:10px;
font-size: 18px;
font-weight:bold;
color:#222;
}
.box:hover {
background-image: url(http://lorempixel.com/output/food-h-g-175-190-3.jpg);
text-indent:-9999em;
}
.box:hover span {
position:absolute;
left:-9999em;
}
.heading-icon {
font-size: 55px;
font-size: 4rem;
color:#8C0921;
margin-bottom: 1rem;
}
The fiddle.
When the box is hovered over, it sets the background image, and removes the text by indenting it off of the screen. It also moves the span, which I'm assuming shows the icon, off of the screen as well.

Text not going underneath other portion of text

My text does not seem to want to go underneath this portion of text!
http://prntscr.com/1x2zju
No matter how hard we try to get it to go under it, it doesn't go below it.
.avatar {
float: left;
width: 35px;
height: 35px;
border: 1px solid #000;
}
.name {
color: #3B63DB;
font-size: 15px;
margin-top: 0;
float: left;
padding-left: 5px;
}
.text {
font-size: 12px;
color: #000;
font-family: Helvetica, 'SEGOEUIL', sans-serif;
margin-left: 3px;
float: auto;
}
HTML:
<div id='post'>
<img class='avatar' src='http://cppsgang.com/images/person.png'>
<p class='name'>Thomas A.</p>
<p class='text'>Hello there! This is my status update. Unfortunately, it will not go below my name. Is there any way I can put it below my name, or is it stuck like this forever? I have to add more in, blah blah blah, to show you how it eventually breaks apart - just not underneath the name. Thanks for all the help you can give!</p>
<a href='system/posts/delete.php?id=$row[0]'/><span style='color: red;'>Delete</span></a>
</div>
Thanks!
http://jsfiddle.net/QUFx5/
EDIT WITH WORKING
JSFIDDLE
HTML
<div id='post'>
<img class='avatar' src='http://lorempixel.com/output/people-q-c-35-35-9.jpg'>
<p class='name'>Thomas A.</p>
<p class='text'>Hello there! This is my status update. Unfortunately, it will not go below my name. Is there any way I can put it below my name, or is it stuck like this forever? I have to add more in, blah blah blah, to show you how it eventually breaks apart - just not underneath the name. Thanks for all the help you can give!</p>
<a href='system/posts/delete.php?id=$row[0]'/><span style='color: red;'>Delete</span></a>
</div>
CSS
.avatar {
float: left;
width: 35px;
height: 35px;
border: 1px solid #000;
}
.name {
color: #3B63DB;
font-size: 15px;
margin: 0;
padding-left: 45px;
}
.text {
font-size: 12px;
color: #000;
font-family: Helvetica, 'SEGOEUIL', sans-serif;
margin-left: 5px;
padding-left:45px;
margin:0;
}
I have tried with your jsfiddle.net.
This thing worked for me:
.avatar {
float: left;
width: 50px;
height: 50px;
border: 1px solid #000;
}
.name {
color: #3B63DB;
font-size: 15px;
margin-top: 0;
padding-left: 5px;
}
.text {
font-size: 12px;
color: #000;
font-family: Helvetica, 'SEGOEUIL', sans-serif;
margin-left: 3px;
}
I have removed float from name and text class. Also, increased the width & height of avatar to 50px each.
The new code I tried which works according to your requirement:
.avatar {
float: left;
width: 35px;
height: 35px;
border: 1px solid #000;
}
.name {
color: #3B63DB;
font-size: 15px;
}
.text {
font-size: 12px;
color: #000;
font-family: Helvetica, 'SEGOEUIL', sans-serif;
margin-top:-15px;
}