inline div issue in ie7 - html

I've created a simple widget in JQuery that wraps texboxes in a div, adds a clear text button and a placeholder. Added the main bits for this at http://jsfiddle.net/BpkDN/, something in the CSS which I can't find is messing the styling up in ie7. Seems to work in every other version.
Here is an extract of what my widget produces:
CSS:
::-ms-clear {
display: none;
}
.jui-textbox {
border: 1px solid #DADADA;
position: relative;
padding:0 !important;
white-space: nowrap;
background: #fff;
overflow: hidden;
height: 33px;
line-height: 33px;
display: inline-block;
*display:inline;
margin: 10px 0;
}
.jui-textbox input {
background-color: transparent;
color: #313131;
height: 33px !important;
line-height:33px\9;
width: 300px;
font-size: 14px;
font-family: 'Open Sans', sans-serif;
padding: 0;
margin: 0 5px !important;
border: none;
float:left;
}
.jui-textbox-placeholder {
position: absolute;
font-size: 14px;
font-family: 'Open Sans', sans-serif;
color: #A1A1A1;
height: 33px;
line-height: 33px;
padding: 0;
margin: 0;
left: 5px;
overflow: hidden;
cursor: text;
}
.jui-textbox-hover {
border: 1px solid #CACACA;
}
.jui-textbox-active {
border: 1px solid #a1a1a1;
}
.jui-textbox-clear.show{
display:inline-block !important;
*display:inline !important;
}
.jui-textbox-clear {
display:none;
cursor: pointer;
background: #fff;
border-left: 1px solid #a1a1a1;
width: 33px;
height: 33px;
background-image:url(icons/x.png);
background-position:center;
background-repeat:no-repeat;
}
.jui-hoverable:hover,.jui-hoverable-hovered
{ background-color: #f1f1f1;}
textarea:focus, input:focus{
outline: none;
}
Html
<div class="jui-textbox">
<div class="jui-textbox-placeholder" unselectable="on" style="font-size: 14px;">
Default
</div>
<input type="text" style="width: 300px;">
<div class="jui-textbox-clear jui-hoverable jui-icons-x"></div>
</div>

Try this:
CSS:
::-ms-clear {
display: none;
}
.jui-textbox {
width: 300px;
border: 1px solid #DADADA;
position: relative;
padding:0 !important;
white-space: nowrap;
background: #fff;
overflow: hidden;
height: 33px;
line-height: 33px;
display: inline-block;
/**display:inline;*/
margin: 10px 0;
}
.jui-textbox input {
background-color: transparent;
color: #313131;
height: 33px !important;
line-height:33px\9;
width: 300px;
font-size: 14px;
font-family: 'Open Sans', sans-serif;
padding: 0;
margin: 0 5px !important;
border: none;
float:left;
}
.jui-textbox-placeholder {
position: absolute;
font-size: 14px;
font-family: 'Open Sans', sans-serif;
color: #A1A1A1;
height: 33px;
line-height: 33px;
padding: 0;
margin: 0;
left: 5px;
overflow: hidden;
cursor: text;
}
.jui-textbox-hover {
border: 1px solid #CACACA;
}
.jui-textbox-active {
border: 1px solid #a1a1a1;
}
.jui-textbox-clear.show{
display:inline-block !important;
*display:inline !important;
}
.jui-textbox-clear {
display:none;
cursor: pointer;
background: #fff;
border-left: 1px solid #a1a1a1;
width: 33px;
height: 33px;
background-image:url(icons/x.png);
background-position:center;
background-repeat:no-repeat;
position: absolute;
right: 0;
}
.jui-hoverable:hover,.jui-hoverable-hovered
{ background-color: #f1f1f1;}
textarea:focus, input:focus{
outline: none;
}
HTML:
<div class="jui-textbox">
<div class="jui-textbox-placeholder" unselectable="on" style="font-size: 14px;">
Default
</div>
<input type="text" style="width: 300px;">
<div class="jui-textbox-clear jui-hoverable jui-icons-x"></div>
</div>
<br/>
<div class="jui-textbox">
<div class="jui-textbox-placeholder" unselectable="on" style="font-size: 14px;">
Focused
</div>
<input type="text" style="width: 266px;">
<div class="jui-textbox-clear jui-hoverable jui-icons-x show"></div>
</div>
Tested in IE7 (Vista).
Demo: http://jsfiddle.net/PENFT/
Another solution, but it's not very clean:
Removing width from .jui-textbox.
Adding float:left; to ".jui-textbox" and changing <br/> with <br
style="clear:both" />.
Note: <br style="clear:both" /> its so dirty.

In this case JavaScript is the simple hack, because in IE7 :focus doesn't work. Take a look at the ie7-js project.
IE7.js is a JavaScript library to make
Microsoft Internet Explorer behave
like a standards-compliant browser. It
fixes many HTML and CSS issues and
makes transparent PNG work correctly
under IE5 and IE6.
Upgrade MSIE5.5-7 to be compatible with MSIE8.
<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->
You can also refer to this SO question. IE7 doesn't support this pseudo class.

Related

Height of the select option box

I have a form in which one input field is select and it has few option.I am not able to increase the height of the option box and background color.presently it has white colour as given in the picture My html code and css code is below
.select2 {
width: 100%;
overflow: hidden;
font-size: 20px;
padding: 4px 0;
margin: 4px 0;
border-bottom: 2px solid black;
background-color: transparent;
}
.select2 option{
width: 26px;
background-color: none ;
border: none;
background: none;
color: blue;
font-size: 20px;
font-weight:bold;
float: left;
margin: 0 10px;
white-sapce: no-wrap;
text-overflow: ellipsis;
}
.select2 after {
!content: 'Select Role';
font-family: 'material icons';
font-size: 24px;
color: red;
position: absolute;
right: 10px;
top: 10%;
transform: translateY(-50%);
pointer-events: none;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css">
<div class="select2">
<i class="fas fa-user-lock" style="color:black; padding:10px;"> Role</i>
<select >
<option value=""></option>
<option value="user">USER</option>
<option value="rec">Recommending Officer</option>
<option value="store">Store</option>
</select>
</div>
You can use this to increase height:
.select2 select{
height: 50px;
background: transparent;
}
Add more properties here to style the box.
Also correct way to use before and after is :
.select2::after {
....
}
Codepen
Try giving style to select tag, this might works!
select{
width: 50%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-size: 20px;
}
Try this
.select2 {
width: 100%;
overflow: hidden;
font-size: 20px;
padding: 4px 0;
margin: 4px 0;
}
select{
height:30px;
border-bottom: 2px solid black;
background-color: transparent;
}

How to add arrow on the right of drop down list button using CSS

I'm developing drop down list in polymer. Currently I have problem with CSS.
Here you can find example:
jsfiddle example
<div style="width:200px" class="button initial gray">
<div style="padding-left:12px;padding-right:12px;">
<div class="button-value truncated" style="width:inherit;">
Select value very long label with dots at the end
</div>
<div class="arrow">▼</div>
</div>
</div>
I need to create the following drop down list, but I have problem with arrow visible on the right of button.
Question is, how to achieve this:
gif example
I will be very grateful for your help !!!!
You need to use this
text-overflow: ellipsis;
overflow: hidden;
then you will see the three dots after your list item, but also you need to add width for your span
width: 100px
Code example
<div style="width:200px" class="button initial gray">
<div style="padding-left:12px;padding-right:12px;">
<div class="button-value truncated" style="width:158px; display: inline-block">
Select value very long label with dots at the end
</div>
<div style="display: inline-block;margin-top: 12px;vertical-align: top;"class="arrow">▼</div>
</div>
</div>
div.button.orange {
border: 1px solid #FF6200;
background: inherit;
background-color: #FF6200;
border-radius: 5px;
box-shadow: none;
font-family: 'ING Me';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: white;
cursor: pointer;
height: 36px;
box-sizing: border-box;
box-shadow: 1px 1px 5px lightgray;
}
div.button.gray {
border: 1px solid #767676;
background: inherit;
background-color: white;
border-radius: 5px;
box-shadow: none;
font-family: 'ING Me';
font-weight: 400;
font-style: normal;
font-size: 12px;
color: #FF6200;
cursor: pointer;
height: 36px;
box-sizing: border-box;
box-shadow: 1px 1px 5px lightgray;
position:relative;
}
div.button.gray.initial {
color: #767676;
}
div.button.active {
border-radius: 4px 4px 0px 0px;
border: 1px solid #FF6200;
}
div.button-value {
text-align: center;
line-height: 36px;
width: inherit;
}
ul.options>li {
padding-left: 12px;
padding-right: 12px;
line-height: 36px;
}
.truncated {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
ul.options {
color: black;
list-style-image: none;
list-style: none;
list-style-type: none;
border-radius: 0px 0px 4px 4px;
box-sizing: border-box;
position: absolute;
width: auto;
margin: -1px;
padding: 0;
list-style: none;
border: 1px solid #FF6200;
border-top: none;
background-color: white;
box-shadow: 1px 1px 5px lightgray;
}
ul.options>ul {
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul.options>li:hover {
color: white;
background-color: #FF6200;
text-decoration: underline;
}
.arrow{
position:absolute;
right:4px;
top:0;
line-height:36px;
}
<div style="width:200px" class="button initial gray">
<div style="padding-left:12px;padding-right:18px;">
<div class="button-value truncated" style="width:inherit;">
Select value very long label with dots at the end▼
</div>
<div class="arrow">▼</div>
</div>
</div>

HTML / CSS: Div not expanding to height of content

I've got a few div elements that aren't expanding to match the height of their content. I have read that this can be caused by float-ed content; This content isn't float-ed - although I am beginning to feel like I should throw my computer in a river. Does that count?
code:
#interaction-options-container.display-dialogue {
left: 15%;
width: 70%;
}
#interaction-options-container.full-border, .dialogue-container.full-border {
border: 1px solid #33ffff;
}
#interaction-options-container {
margin: 4px 0px 4px 0px;
z-index: 100;
position: absolute;
left: 35%;
bottom: 4%;
width: 30%;
line-height: 1.4;
opacity: 0.75;
}
#interaction-options-container .heading {
font-size: 16px;
color: black;
padding: 0.1px 12px 0.1px 12px;
background-color: grey;
}
.heading {
font-weight: bold;
font-size: 1.5em;
padding: 8px 12px 0px 12px;
}
#interaction-options-container p {
margin: 8px 0px 8px 0px;
}
#interaction-options-container .dialogue p {
margin: 4px 0px 4px 0px;
}
#interaction-options-container .button, #interaction-options-container .evidence-options-container .button {
cursor: pointer;
color: white;
font-size: 14px;
padding: 0.1px 12px 0.1px 12px;
background-color: #333333;
opacity: 0.85;
border-bottom: 1px solid #8d8d8d;
}
#interaction-options-container .dialogue-container {
padding: 0px;
margin: 0px;
width: 100%;
height: 32px;
background-color: #333333;
float: none;
}
#interaction-options-container .dialogue {
text-align: center;
margin: auto;
font-size: 16px;
font-weight: bold;
padding: 1px 12px 1px 12px;
color: white;
background-color: #333333;
}
.dialogue-container .dialogue.option-divider {
border-bottom: 1px solid #333333;
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
<div class="hud-element display-dialogue full-border" id="interaction-options-container">
<div class="heading"><p>Choose a reply:</p></div>
<div class="dialogue-container button">
<div class="dialogue option-divider"><p>Option one here</p></div>
</div>
<div class="dialogue-container button">
<div class="dialogue option-divider"><p>Option two here</p></div>
</div>
<div class="dialogue-container button">
<div class="dialogue option-divider"><p>Option three here</p></div>
</div>
<div class="dialogue-container button">
<div class="dialogue"><p>Option four here. As an example this text should be long enough to require wrapping to a new line. I will therefore have to keep typing until I've added enough text to sufficiently fill the horizontal with of the containing div. Also, thanks for potentially answering my question, which I will get to below...</p></div>
</div>
</div>
The problem is, when a piece of dialogue requires wrapping to a new line, the .dialogue-container .button div does not expand in height to match the height of the .dialogue div. The inner divs therefore extend past the border lines, which looks bad.
If anyone has any pointers, my computer will thank you.
Cheers.
#interaction-options-container .dialogue-container {
padding: 0px;
margin: 0px;
width: 100%;
//height: 32px;
background-color: #333333;
float: none;
}

CSS challenge: Using two div and contenteditable div to Create a 凸 shape

I want to create something like the picture, where the #body is between #leg1 and #leg2, three of them should be horizontally in line to the bottom. Any idea how to achieve this? I tweaked some property such as display:inline, or float:left, float:right, but none of them work as I expect.
.comment_leg {
s width: 60px;
/*height:18px;*/
background-color: #ffcc99;
padding: 5px;
text-align: center;
border-radius: 3px;
}
[contenteditable=true]:empty:before {
content: attr(placeholder);
display: block;
For Firefox
}
#body {
background-color: white;
/*position:relative;*/
border: 1px solid orange;
/*height:60px;*/
width: 500px;
padding: 10px;
color: black;
border-radius: 3px;
font-size: 18px;
/*border-color:yellow;*/
}
#body:focus {
outline-style: solid;
outline-color: orange;
outline-width: 0px;
}
<br>
<br>
<br>
<div class="comment_leg">leg1</div>
<div id="body" contenteditable="true" autocomplete="off" spellcheck="false" placeholder="Pika pi?"></div>
<div class="comment_leg">leg2</div>
From what I understood of your "凸" shape I guess this is what you want:
NOTE: You can adjust height and width depending on your preference.
.comment_leg {
width: 60px;
/*height:18px;*/
background-color: #ffcc99;
padding: 5px;
text-align: center;
border-radius: 3px;
vertical-align: bottom;
display: inline-block;
}
[contenteditable=true]:empty:before {
content: attr(placeholder);
display: block;
For Firefox
}
#body {
background-color: white;
border: 1px solid orange;
min-height:100px;
width: 150px;
padding: 10px;
color: black;
border-radius: 3px;
font-size: 18px;
display: inline-block;
vertical-align: bottom;
}
#body:focus {
outline-style: solid;
outline-color: orange;
outline-width: 0px;
}
<div class="comment_leg">leg1</div>
<div id="body" contenteditable="true" autocomplete="off" spellcheck="false" placeholder="Pika pi?"></div>
<div class="comment_leg">leg2</div>

Box-Shadow isn't appearing?

On this page the box-shadow style doesn't seem to appear, however this has only been an issue since the hyperlinks have been added. Please see the code.
The box-shadow seems to work fine in Chrome and this issue is mainly in Internet Explorer.
The box-shadow is around the DIV ID="container".
Thanks for your help!
Here is the HTML for the page..
`<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<div id="container">
<div id="header">
<div id="logo">
<img src="images/logo.png">
</div>
<div id="title">
<h1>FOOTBALL MANAGER</h1>
<h2>HOME</h2>
</div>
</div>
<div id="nav">
Home
How To Install
Where To Buy
About Us
Contact Us
</div>
<div id="mheading">
<h4>Heading</h4>
</div>
<div id="fmlogo">
<p>fmlogo</p>
</div>
<div id="footer">
<span>
Copyright 2013 Top Notch Multi-Media
</span>
<span id="update">
Site last updated at 22:15 23 November 2013
</span>
</div>
</div>
</body>
</html>
`
And the CSS..
'
#charset "utf-8";
body {
height:1100px;
background-color:#999; /*needs defining in house style */
margin:0px;
padding:0px;
}
h1 {
font-family: Verdana;
font-size: 53px;
text-shadow: 1px 1px 7px #000;
}
h2 {
font-family:Verdana;
font-size:35px;
text-shadow: 1px 1px 7px #000;
}
h3 {
font-family: Verdana;
font-size: 20px;
}
h4 {
font-family:Verdana;
font-size:35px;
margin: 0px;
}
#container {
width:950px;
height:1100px;
margin:0 auto;
background-color:#FFF;
border-style:solid;
border-width:1px;
border-color:#000;
/*order goes Horizontal offset, Vertical offset, Blur radius, Spread distance, Color */
box-shadow:0px 0px 100px 10px #000;
}
#header {
position:relative;
height:170px;
background-color: #30A7BF;
margin:0px auto;
padding: 1px;
}
#title {
position:absolute;
top: 15px;
left: 315px;
}
#nav {
position:relative;
height: 60px;
margin: 0 auto;
background-color:#CF6;
border-style: solid;
border-color: black;
border-bottom-width:2px;
border-top-width:2px;
border-right-width:1px;
border-left-width:1px;
text-align: center;
}
a {
position: relative;
top: 3px;
display: inline-block;
margin: -3px;
height: 56px;
width: 188px;
background-color: #E39734;
border-style: solid;
border-width: 2px;
border-color: #000;
text-align: center;
font-family: Verdana;
font-size: 20px;
line-height: 55px;
}
#button {
position: relative;
top: 3px;
display: inline-block;
margin: -3px;
height: 56px;
width: 188px;
background-color: #E39734;
border-style: solid;
border-width: 2px;
border-color: #000;
text-align: center;
font-family: Verdana;
font-size: 20px;
line-height: 55px;
}
.button:hover {
background-color: #BD7E2D;
}
a:link {
text-decoration: none;
color: #000;
}
a:visited {
text-decoration: none;
color: #000;
}
a:hover {
text-decoration: underline;
color: #636363;
}
#logo {
position:absolute;
height:130px;
width:340px;
top:17px;
left: -10px;
border-style: solid;
border-width:0px;
border-color:black;
}
img {
width: 100%;
}
#mheading {
position:relative;
top: 10px;
left: 5px;
width: 940px;
height: 50px;
border-style: solid;
border-width: 1px;
border-color: #000;
text-align:center
}
#fmlogo {
position: relative;
margin: 0px;
top: 649px;
margin: 0 auto;
width: 940px;
height: 100px;
border-style: solid;
border-color: #000;;
border-width: 1px;
text-align: center;
}
#footer {
position: relative;
margin: 0px;
top: 659px;
width: 940px;
height: 30px;
background-color: #9F3;
border-style: solid;
border-color: black;
border-top-width: 1px;
border-right-width: 0px;
border-bottom-width: 1px;
border-left-width: 0px;
padding-left: 5px;
padding-right:5px;
padding-top: 20px;
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
}
#update {
float: right;
}
'
What version of IE are you using? If it's IE 9 or below you have to use the following within your container class css declaration:
border-collapse: separate;
Look the answer I found here:
http://blog.mi-ernst.de/2013/04/06/ie9-ie10-css-shadow-not-rendered/
Yesterday I got the problem that IE does not render the box-shadow
property. After a while a figgured out that the property
“border-collapse: collapse;” for a surrounding table prevents the
rendering. I got the property inherited from a stylesheet of a JS
Framework. After manipulating my css to the following configuration:
.shadowed {
-moz-box-shadow: 0 0 5px 5px #DDD;
-webkit-box-shadow: 0 0 5px 5px #DDD;
box-shadow: 0 0 5px 5px #DDD;
border-collapse: separate;
}