I have this HTML in JSFiddle: http://jsfiddle.net/p5Dqw/
When I try to put margin-top: 5px; or padding-top: 5px; to #newsPaneText, it either moves the entire #newsPane div itself down, which I didn't even think was possible, or it moves the text inside down like 25 pixels extra, seemingly for no reason at all. On line 102, add padding-top: 5px; or margin-top: 5px to see what I'm talking about. What is going on here? I have no idea why this is happening.
I know my solution may be not valid but it may help you to solve your problem.
You need to add margin-top to make it work.
margin-top: 16px;
padding-top: 5px;
See This JSFiddle
As i understood you have to add line-height, correct me if you are
asking different question?
in line 105 add this two lines of css (change the values if you
need)
line-height:10px;
padding-top:5px; or margin-top 5px;
Hope this helps you
I don't know what was going on, but putting display: inline-block; in #newsPane and margin-top: -10px; in #newsPaneText fixed the issue.
Related
I am having a very difficult time getting rid of this persistent 5px whitespace on my website eternalminerals.com
I highlighted it in this screenshot: http://s15.postimg.org/de4sjvqob/5pxwhitespace.png
In google chrome, if I edit the element to have a margin-top: -5px, it gets rid of the whitespace, but since I am using Avada shortcodes, I cannot attach this style to it since it is a shortcode:
<p style="text-align: center; margin-top: -10px; font-size: 19px !important; line-height: 42px !important; color: #FFE396!important; font-family: 'MuseoSlab500Regular', Arial, Helvetica, Sans-Serif;"><strong>That's my opinion. I am Dr George Lundberg, at large at The Eternal Minerals of Life.</strong></p>
</div>
[/raw]
[fullwidth backgroundcolor="#140100" backgroundimage="" backgroundrepeat="no-repeat" backgroundposition="top left" backgroundattachment="fixed" bordersize="0px" bordercolor="#e5e4e4" paddingTop="-5px" paddingBottom="0px"]
<br>
[ajax_load_more post_type="testimonials-widget" posts_per_page="5" pause="true" transition="fade" button_label="Click to show testimonials from real physicians"]
[/fullwidth]
As you can see, paddingTop="-5px" doesn't cut it. Does anyone have a better idea on how to get rid of this whitespace? I will keep trying and keep you posted on my findings. Thank you so much!!!
It is because of the line-height taking for all the individual elements. After changing the line-height of the body tag that space will disappear. Below is the code.
body {
line-height: 0.7;
}
As all the elements are having individual line-height you can give even lesser value (<0.7) for line-height of the body tag.
So although the originally accepted answer of using the line-height worked, it messed up all of the line-heights on the page, and after a little bit more tinkering, all that was needed was to add the margin-bottom: -5px; to the canvas element.
This solution is less invasive and achieves the same visual effect, so I will be accepting my own answer as the solution instead. Sorry Masoom!
This is the code now:
<canvas id="matrix" style="margin-left:-20px;margin-bottom:-5px;"></canvas>
So I have a problem and hope you could help me out here for I am out of ideas:
I try to create a html/css-based bill of fare (I hope it's right... perhaps "menu" is better english? sry, german here), and it worked out fine so far, but there's one little flaw in my css I cant' figure out.
To make things clearer, I created a fiddle over here: [removed, the picture makes it clear :) ]
So in the fiddle you see the "days"-line, which css-class .day have just the same percentual width than my menu-cssclass.
Here's the corresponding css:
.a4 .days td div {
color: #ffffff;
font-size: 20px;
padding: 6px 0 4px;
text-align: center;
display: inline-block;
width: 14.28%;
border-right: 2px solid white;
box-sizing: border-box;
font-family: 'OpenSans_SemiBold';
}
...and
.a4 .menu-item {
width: 14.28%;
float: left;
vertical-align: top;
margin-bottom: 5px;
}
So I thought menus and day-fields would be aligned correctly. But sadly, as seen in the fiddle, the nearer my plan goes "to sunday", the less space is between the menu and the end of the day-rectangle.
I hope someone here could help me out, because after trying to change position: relative to absolute and some other Ideas I am out of Ideas now and clearly in need of help.
edit: here's a screenshot from the comments better describing my problem! actually, I want all fields to look like the "Monday" with the same margin between pictures and end of "monday"-headline (sry for my bad english):
On this line remove colspan="2"
<tr class="content">
<td class="hspace border-color">
<td class="border-color" colspan="2"> <--- here
And the reason is your table rows are of different width, the "days" row is 1174px and the "content" row is 1204px, so 14.28% of that width gives two different values
I'm not sure if i understand your problem correctly but i think this might help.
http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/static/flat/css3-modsel-33.html
Use the last class to target the Sunday and give it a bigger margin? If that is what you want.
I hope this helps!
This question is based on this JSFiddle. It is a navigation design with two top level menu items and three submenus (structured for accessibility without script). An element to look at may be:
<nav class="top-menu">
There is one pressing issue:
Just open the JSFiddle in Internet Explorer and see. Why does it drop down like that only in IE? Even in IE9 and 10.
Any help here will be greatly appreciated!
I have noticed that "top-header" blocks had different heights, and to fix this I've added line-height CSS rule:
.top-header {
padding: 0 0 5px 0;
display: inline-block;
margin-left: 20px;
position: relative;
+ line-height: 28px;
}
And it currently seems same for me in IE and Chrome.
Updated fiddle
add
height :136px \0/;
at the end of .top-header
and the problem will be solved check
jsfiddle
You may use some 'tape' to fix this in IE. :)
Via CC, add a border-bottom: white 10px solid; or outline:white 10px solid;
http://jsfiddle.net/SKJvv/7/ http://jsfiddle.net/SKJvv/8/
It doesn't explain much what layout is playing about.
(CC included : http://jsfiddle.net/SKJvv/10/ )
Simple html formatting that I just can't seem to gt right.
I have the following div:
<div class="fc-event-time" data-hasqtip="true" aria-describedby="qtip-6">
2:54 - 6:54
<i class="icos-refresh" style="float: right; margin-top: -17px; margin-right: 2px"></i>
<i class="icos-acces-denied-sign" style="float: right; margin-top: -17px; margin-right: 2px"></i>
</div>
that according to firebug has the following css classes acting on it:
padding-left: 5px;
white-space: nowrap;
font-weight: 500;font-size: 12px !important;
padding: 0px 1px;
color: rgb(0, 0, 0) !important;
cursor: pointer;
direction: ltr;
text-align: left
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
line-height: 18px;
Now the above code is rendering like below:
if you can see, there are two icons on top of one another, the <i></i> elements', my problem is that I would like to have it side by side. My first thought was to adddisplay:block;` but that doesn't work. how can I have them line up rather than superimposed?
UPDATE:
After taking out the margin-top: -17px; I get the following results, but I need them (the text and the icons) to be in the same row.
UPDATE 2:
Finally Figured out the problem and fixed this issue, it turned out to be the 2:54 - 6:54 plain text that was not allowing the <i>s to get in the same line. all I did was modify the Full Calendar source to place the time inside a <span> and gave it a style attribute of `float: left' and its all lined up and working now. Thank you all for helping, if a better answer is submitted (one that I don't need to modify the javascript I will still award it as an answer since that would be a better method.
As far as I can tell you don't have any widths applied to your i icons, plus the negative margin-tops could be playing havock with the floats. If you define actual widths for your i elements you shouldn't have a problem (at least based on what I can see).
If that doesn't work you may also have some kind of absolute positioning involved. If this is the case, and is applied to the i elements, then you'll need to remove it.
But without seeing the style applied to the i elements it's a bit impossible to tell.
update
Ah, ok so the negative top margin was causing the issue. In order to get your text and your icons to align on the same line you'll have to wrap the text with a span and apply a float:left to it.
<span style="display: block; float:left;">2:54 - 6:54</span>
<i class="icos-refresh" style="float: right; margin-right: 2px"></i>
<i class="icos-acces-denied-sign" style="float: right; margin-right: 2px"></i>
However I'd recommend that you not use inline styles and extract these to specific css classes.
I have used font-size: 0; on the parent element and that's how I got the links to have no spaces but the space is still there in Firefox.
Please test this in Firefox and then any other browser and you'll see that Firefox is showing a space (albeit 1px) between the links where as no other browser is doing this... well IE6&7 but lets not talk about them...
http://jsfiddle.net/uZMzA/
Does anyone know why? And how I could go about and solving it without using javascript to determine the browser?
The reason why this is happening is because there is a text-node with a line-break in between the a-tags. And since you have set letter-spacing: 1px; and the firefox coders have chosen to implement letter-spacing the way they have, you get 1px of letter spacing after or before that textnode.
The solution, as already hinted at elsewhere, is to change the rule for div#navigation to not have the line letter-spacing: 1px in it, like this:
div#navigation {
position: relative;
padding: 1px 0;
border-top: 1px solid black;
border-bottom: 1px solid black;
font-family: Georgia, Serif;
margin: 0 auto 2px auto;
width: 400px;
font-size: 0;
text-shadow: 0 1px #fff;
}
You can see a working version with the fix applied here: http://jsfiddle.net/uZMzA/10/
maybe you mean:
letter-spacing: 0
This cause your "bug"
Edit:
If you want the letter spacing at 1px, this is a good solution, fiddle up
Just adding:
display: inline-block to the Div container css and float: left to the a element.
Read this post. You will find all available techniques on its body and comments, as well as their tradeoffs.
http://css-tricks.com/fighting-the-space-between-inline-block-elements/
The "remove the spaces" option is mentioned first, as it's the easiest to implement. But it's also "a bit funky".
The "letter-spacing - based" option is listed in the comments, but notice that you will have to include additional css if you want to make IE < 8 happy.
Simply remove the white space from your code like this jsFiddle example.
HTML:
<div id="navigation">
Link1Link2Link3Link4
</div>
This is silly and I can't really explain the "why" of that occurrence but here are two ways to correct the display.
FF doesn't like the space in the code. Either remove the carriage returns between your <a> tags or comment them out, like this:
<div id="navigation">
Link1<!--
-->Link2<!--
-->Link3<!--
-->Link4
</div>