I am using tinyMCE editor, and I am using 2 same divs with float:right; in the CSS.
The issue I am having is that when I save the HTML, and open the saved content on any browser, it doesn't look the same as in the editor.
As an example I have attached 2 pictures, note there is a difference in the height of the blue boxes (in the editor and in the output).
Editor:
Output:
Here is the HTML in the editor:
<div class="sub-mw" div="">
1 <br />1<br />1<br />1<br />
<!--#*#TStem1#*#-->
<div id="enews">
<div class="enewstext">News</div>
</div>
<!--#*#TEtem1#*#-->
<br /><br /><br />
<!--#*#TStem1#*#-->
<div id="enews">
<div class="enewstext">News</div>
</div>
<!--#*#TEtem1#*#-->
1<br />1<br />1<br />1<br />1<br /><br />as<br />dasd
<br />asd<br />a<br />da
</div>
Also Here is the css used:
.enewstext {
color: #FFF;
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
padding-top: 15px;
padding-bottom: 15px;
background: #0163b1;
width: 100%;
box-shadow: 0px 5px 0px #FFF;
text-indent: 20px;
}
#enews{
background:#3394e1;
width:18%;
height:300px;
float:right;
}
Edit 1:
In this scenario, tracing the issue, it is caused by the <br> tag. It has a smaller height in the tinymce editor than on chrome.
Any Idea on how to fix this ?
Related
I'm using custom datepicker (https://github.com/eternicode/bootstrap-datepicker) inside my form (http://jsfiddle.net/Misiu/a3NV4/22/)
I would like that daterangepicker to take 100% width like all other form elements, but can't get that to work.
My only workaround was to use datepicker css for bootstrap 2. I should use these rules:
#import url('http://getbootstrap.com/dist/css/bootstrap.css');
#import url('http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/css/datepicker3.css');
but instead I'm using (there is missing 3 at end of second line):
#import url('http://getbootstrap.com/dist/css/bootstrap.css');
#import url('http://eternicode.github.io/bootstrap-datepicker/bootstrap-datepicker/css/datepicker.css');
this is what I get when I use bootstrap 3 css:
also on small screen inputs in picker don't have equal width:
I would like to switch entirely to bootstrap 3, but this tiny but is stopping me from doing so.
You could add the col-xs-12 class to your input-group. This will force the group to always be as wide as it's parent container.
<div class="form-group">
<label class="col-sm-3 control-label">Dates range</label>
<div class="col-sm-9">
<div class="input-daterange" id="datepicker">
<div class="input-group col-xs-12">
<input type="text" class="input-small form-control" name="start" />
<span class="input-group-addon">to</span>
<input type="text" class="input-small form-control" name="end" />
</div>
</div>
</div>
</div>
Updated Fiddle
The problem was datepicker custom .input-group-addon css.
.input-daterange .input-group-addon {
width: auto; /*remove this line*/
min-width: 16px;
padding: 4px 5px;
font-weight: normal;
line-height: 1.428571429;
text-align: center;
text-shadow: 0 1px 0 #fff;
vertical-align: middle;
background-color: #eeeeee;
border: solid #cccccc;
border-width: 1px 0;
margin-left: -5px;
margin-right: -5px;
}
after removing width: auto both bugs were fixed, please see: http://jsfiddle.net/Misiu/a3NV4/24/
Using the theme "clean" of Recaptcha with IE9<, the input to enter captcha does not appear in (#recaptcha_table > tbody:nth-child(1) > tr:nth-child(2)), but is shown over again. How to display input correctly changing the css?
I've checked and reCAPTCHA is not working in IE 8 from my end.
The simplest way to resolve this porblem is to create your own style of reCAPTCHA. So, is not necesarry to use the "clean" template from reCAPTCHA.
This code will show your reCAPTCHA (I have made a style similary to "clean"):
Check JSBin: http://jsbin.com/utubal/1/edit OR check below:
<style>
#recaptcha_widget {
width: 400px;
padding: 5px;
border: 1px solid #CCCCCC;
font-family: Calibri, Ubuntu Light, Arial;
font-size: 12px;
}
#recaptcha_widget a {
text-decoration: none;
color: #2D7FC0;
font-weight: bold;
}
#recaptcha_image {
border: 1px solid #CCCCCC;
}
#recaptcha_response_field {
width: 300px;
}
</style>
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'custom',
custom_theme_widget: 'recaptcha_widget'
};
</script>
<div id="recaptcha_widget" style="display:none">
<div style="float:left; width: 80%;">
<div id="recaptcha_image"></div>
<div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect please try again</div>
<span class="recaptcha_only_if_image">Enter the words above:</span>
<span class="recaptcha_only_if_audio">Enter the numbers you hear:</span>
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" style="border: 1px solid #cccccc;"/>
</div>
<div style="float: left; margin-left: 10px;">
<div>REFRESH</div>
<div class="recaptcha_only_if_image">AUDIO</div>
<div class="recaptcha_only_if_audio">IMAGE</div>
<div>Help</div>
</div>
<div style="clear: both;"></div>
</div>
<script type="text/javascript"
src="http://www.google.com/recaptcha/api/challenge?k=YOUR_PUBLIC_KEY">
</script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=YOUR_PUBLIC_KEY"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>
I hope this will help you!
PS.: Please remember to override YOUR_PUBLIC_KEY with your key (2 locations).
I've seen and read numerous posts on this subject but none worked in my environment or I did something wrong. I have a div that contains images and text of various unknown sizes. I want all the images and in the div to be vertically centered. I'm using Internet Explorer 9.
Here is my code, I'm removed all the various techniques I've attempted for the sake of simplicity:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
div.header
{
height:75px;
background-color:#FFF;
padding-left:10px;
padding-right: 10px;
}
div.headerleft
{
border: none;
float: left;
margin: 0;
padding: 0;
}
div.headerright
{
border: none;
float: right;
margin: 0;
padding: 0;
}
h1
{
font: 44px Tahoma, Geneva, Verdana, sans-serif;
margin-bottom: 0;
margin-top: 0;
padding-bottom: 0;
padding-top: 0;
}
img.centerImage
{
vertical-align:middle;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div class="header">
<div class="headerleft">
<img class="centerImage" border="0" alt="Test 1" src="../Images/test1.jpg" />
<img class="centerImage" border="0" alt="Test 2" src="../Images/test2.jpg" />
</div>
<div class="headerright">
<h1>
Centered Text Vertically
</h1>
</div>
</div>
</form>
</body>
</html>
I'd like to emphasize that the text and images are of unknown sizes. I've found this certainly complicates the solution. Also, based on ActiveX requirements, I'm using Internet Explorer version 9. Any advice out there? Thanks!
To use vertical alignment, you are better off setting a wrapper with the display set to table-cell:
See this Fiddle Example!
THE CSS:
/* the vertical alignment class */
.centerImage {
display: table-cell;
vertical-align:middle;
}
THE HTML
...
<div class="headerleft">
<span class="centerImage">
<img border="0" alt="Test 1" src="path_to_image.jpg" />
</span>
<span class="centerImage">
<img border="0" alt="Test 2" src="path_to_image.jpg" />
</span>
</div>
<div class="headerright">
<h1 class="centerImage">Centered Text Vertically</h1>
</div>
...
Tested:
IE9, IE8, OPERA, SAFARI, FIREFOX, K-MELEON, GOOGLE CHROME
Notes:
You should specify the image width and height to a proper HTML validation and to allow a better understanding by the browser.
Read More About This:
CSS Display Property | CSS vertical-align property | CSS Tricks: What is vertical Align?
EDITED
In regards to the comment given by reisio, to have the same vertical point to the images on the left and the text on the right, we can go with a more simple solution:
See the Fiddle Here!
RELEVANT CSS
/* the trick you want */
.centerImage {
vertical-align:middle;
}
div.headerleft {
border: none;
float: left;
margin: 0;
padding: 0;
line-height: 75px;
}
div.headerright {
border: none;
float: right;
margin: 0;
padding: 0;
line-height: 75px;
}
h1 {
font-size: 44px;
font-family: Tahoma, Geneva, Verdana, sans-serif;
margin-bottom: 0;
margin-top: 0;
padding-bottom: 0;
padding-top: 0;
}
RELEVANT HTML
<div class="headerleft">
<img class="centerImage" border="0" alt="Test 1" src="path_to_img.jpg" />
<img class="centerImage" border="0" alt="Test 2" src="path_to_img.jpg" />
</div>
<div class="headerright">
<h1 class="centerImage">Centered Text Vertically</h1>
</div>
For this solution, we use the vertical-align set to the img tag, and the line-height to create the same vertical-point and to align vertically the text.
You can read: CSS line-height Property
EDITED
If you can't set a height to the images, the only way to solve your issue is to use a bit of JavaScript to dynamically find the tallest image and apply that height to the line-height on the H1 tag.
See this working Fiddle!
JQUERY
$(document).ready(function() {
// initialize the variable to 0
var height = 0;
// run by each image to find the tallest
$('.headerleft img').each(function() {
height = ($(this).outerHeight(true)>height) ? ($(this).outerHeight(true)) : height;
});
// vertical center the text
$('.headerright h1').css({"line-height": height + "px"});
});
Note:
Removed the line-height from the div.headerleft and div.headerright since it is not longer needed!
I'm working on my website and I'm testing it out in all browsers and I love everything except the one thing IE 6 & 7 have been doing to my recent work gallery. I understand a lot of individuals don't feel supporting IE 6 is worth it however it's doing the exact same thing in IE 7 too. So I have to see whats going on.
My recent work gallery is supposed to have 2 rows and 3 columns, however in IE 6 & 7 it has 3 rows and 2 columns and I've tried some changes but it still looks the same.
This is how it looks in IE 6 & 7
This is how it looks in IE 8
CSS
![#RECENTWORK-WRAPPER {
width: 100%;
background: url(../images/irongrip.png) repeat;
color: #fff;
clear: both;
}
.RECENTWORK-CONTAINER {
width: 95%;
max-width: 1040px;
margin: 0 auto;
overflow: hidden;
/*border: 1px solid #000;*/
}
.galleryItem {
color: #797478;
font: 10px/1.5 Verdana, Helvetica, sans-serif;
float: left;
}
.galleryItem h3 {
text-transform: uppercase;
}
.galleryItem img {
max-width: 100%;
padding: 3px;
border: 1px solid #fff;
}
.galleryItem {
color: #797478;
font: 10px/1.5 Verdana, Helvetica, sans-serif;
float: left;
width: 29.33333%;
margin: 2% 2% 30px 2%;
}]
HTML
<div id="RECENTWORK-WRAPPER">
<div class="RECENTWORK-CONTAINER">
<h3><span>Recent Work</span></h3>
<div class="galleryItem">
<img src="images/recentwork-imageWH.jpg" alt="HOME GALLERY" />
</div>
<div class="galleryItem">
<img src="images/recentwork-imageWH.jpg" alt="HOME GALLERY" />
</div>
<div class="galleryItem">
<img src="images/recentwork-imageWH.jpg" alt="HOME GALLERY" />
</div>
<div class="galleryItem">
<img src="images/recentwork-imageWH.jpg" alt="HOME GALLERY" />
</div>
<div class="galleryItem">
<img src="images/recentwork-imageWH.jpg" alt="HOME GALLERY" />
</div>
<div class="galleryItem">
<img src="images/recentwork-imageWH.jpg" alt="HOME GALLERY" />
</div>
</div>
</div>
Do you know what is going on?
Any help is appreciated!
I think this might be your problem
width: 29.33333%;
Try taking that down to like 25% and see what it does. Sometimes padding and borders are a few pixels bigger on some browsers than others. If that works, then slowly increment it upward until it works in IE7
I have bizarre css behavior. I have a div container (#right-input) that houses a textarea and button and they pop out of #userinput container if I do not delete the font: x-small arial,helvetica,sans-serif; in a body tag that I have. Anyone have any ideas? How can a font declaration affect an element like that?
body {
font: x-small arial,helvetica,sans-serif;
background: #000;
margin:0;
text-align:center;
}
#userinput {
font-size:130%;
color: #333;
margin:10px auto 10px auto;
padding:10px;
background: #F7F7F7;
width:570px;
height:135px;
position:relative;
z-index:9999;
border: 1px solid #888;
-moz-border-radius-bottomleft:7px;
-moz-border-radius-bottomright:7px;
-moz-border-radius-topleft:7px;
-moz-border-radius-topright:7px;
opacity: 0.85;
/* for IE */
filter:alpha(opacity=85);
}
#right-input{
clear:left;
float:right;
width:480px;
}
<div id="userinput">
<div id="right-input">
Send a message to others watching!
<form id="form" action="form.php?action=add" method="post">
<TEXTAREA id="message" class="limited" name="message" maxlength="1000" COLS="45" ROWS="6"></TEXTAREA>
<br>
<input id="send" type="submit" value="Send!" />
</form>
</div>
</div>
With your current code, if you resize #right-input, it doesn't adjust #userinput because #right-input is floated which takes it out of the document flow.
Try changing your html to this:
<div id="userinput">
<div id="right-input">
Send a message to others watching!
<form id="form" action="form.php?action=add" method="post">
<TEXTAREA id="message" class="limited" name="message" maxlength="1000" COLS="45" ROWS="6"></TEXTAREA>
<br>
<input id="send" type="submit" value="Send!" />
</form>
</div>
<!-- added div to clear float -->
<div style="clear:both;"></div>
</div>
It should make sure that your textarea will stay inside its div.
If you say that font: x-small causes the problem, try to replace it with
font-size: 14px; /* 14px - for example */
font-family: arial,helvetica,sans-serif;