IE shows mirrored image as before/after content - css

Only IE shows the img.png image mirrored. Why? How do I cope with it without creating a mirrored image specifically to IE?
body {
direction: rtl;
}
li:before {
content: url(/img/img.png);
}
Fiddle: http://jsfiddle.net/Txza7/2/

Well, Problem solved: I had to set direction: ltr ruler to li:before in order to get it right.
body {
direction: rtl;
}
li:before {
content: url(/img/img.png);
direction: ltr;
}

Related

Rendering 2 blocks as a single element

I have a bunch of html output that I receive like this
<div>
<h4>This</h4><p>Value 9.6 m.</p>
<h4>That</h4><p>Value 9.6 m.</p>
<h4>The other</h4><p>Another 7.69 m.</p>
<h4>And yet</h4><p>Another value 4.8 m.</p>
</div>
and I want to have it rendered something like this
This: Value 9.6 m.
That: Value 9.6 m.
The other: Another 7.69 m.
And yet: Another value 4.8 m.
I think it probably should have been created as a definition list, but i don't control the html generation.
I can get the first h4 p 'block' to render correctly with the following but I can't seem to get subsequent 'blocks' to render as desired.
h4:after {
 content: ": ";
 display: inline;
 white-space: nowrap;
 } 
h4 {
 display: block; }
h4~p {
 display: block; }
 
h4:first-child { 
display: inline;}
h4+p {
 display: inline;
 }
Any suggestions on how to achieve the desired output?
TIA
If you don't need a tidy column or grid layout for these, I found Ye Olde Floats worked best:
// normalize the spacing and stuff between the h4 and p
h4, p {
display: block;
line-height: 1.4;
padding: 0;
margin: 0;
}
h4 {
// honestly, this got the most sturdy result
float: left;
// add the colon and a little space
&:after {
content: ": ";
margin-right: 10px;
}
}
// break the line after each P
p {
&:after {
display: block;
clear: right;
content: "";
}
}
I also threw this into a CodePen.
Also if you would like a more tabular or column-y version, I had some luck with flexbox and css grid.
Hope this helps, happy coding!

How can I add a line break to a string in CSS?

I'm trying to customize a web page for the company I work for. they give the option o use custom css to edit. They don't give the HTML, if you ask how to edit something they will provide the specific code. they provided the below code, and I'm trying to figure out how to insert a line break in the first text string. any ideas?
overflow: hidden;
text-indent: -10000px;
}
.landing .confirmation-container .application-confirmed h1:after {
content: 'THANK YOU FOR APPLYING. WE WILL GET BACK TO YOU SHORTLY.';
float: left;
text-indent: 0;
width: 100%;
}
.landing .confirmation-container .application-confirmed p {
overflow: hidden;
text-indent: -10000px;
}
.landing .confirmation-container .application-confirmed p:after {
content: 'If you did not receive a reply email within 48 hours, please check your spam or email us: hiring#example.com';
float: left;
text-indent: 0;
width: 100%;
}
To insert a new line / line break in that content, use the \A escape characters. In order for the new lines to work properly, you also need to set the white-space property to either pre or pre-wrap.
content: "THANK YOU FOR APPLYING. \AWE WILL GET BACK TO YOU SHORTLY.";
white-space: pre-wrap;
The \A escape sequence will insert a line break. It works the same as adding a < br /> tag to your HTML.
content: 'THANK YOU FOR APPLYING.\A WE WILL GET BACK TO YOU SHORTLY.';
You can use content:"\a" and white-space: pre to create a line break without adding a <br/> tag to your HTML
It works like this:
.landing .confirmation-container .application-confirmed h1 {
display:inline;
}
.landing .confirmation-container .application-confirmed h1:before {
content:"\a";
white-space: pre;
}
Example:
h1 {
display:inline;
}
h1:before {
content:"\a";
white-space: pre;
}
<h1>Header</h1>
\a means line break (character U+000A)
white-space: pre tells browsers to treat it as a line break in rendering.

Css rtl overflow turns into dots (...) what is the solution?

My Arabic text turns into dots
ex: لعبة سوبر ماريو
Became: لعب....
I have tried to add Direction:rtl;
and Text-overflow:clip;
But the issue remains this is the current css settings
[class*="gmcn-smal"] .gm-titl{line-height: 20px;font-weight: 700;font-size: 12px;}
By the way it's working fine with English characters
Works for me:
#s2 { color: red; }
div
{
direction: rtl;
}
span
{
}
JSFIDDLE DEMO

how to style Reddit subgroup to work with RTL languages?

I want to open a subbreddit in hebrew and i want to "mirror" the site using the css sytlesheet so it will fit nicely with the hebrew. I want that the tree structure of the comments will be aligned to the right.
here is an example of what i want to achieve:
before:
image1
after (with damaged text):
image2
so, i want to make the structure of the site to look like in image2, but without damaging the text.
is it possible?
update:
here is the css code that i have right now:
there could be non-relevant selections, i'm just experimenting withe the stylesheet by trial and error:
.thing {
display: inline;
}
.sitetable {
display: inline;
}
div.content {
display: block;
float: right;
}
body {
direction: rtl;
}
.midcol.likes {
float: right;
}
Update2: solved!
i added this line and it fix it:
.child {
padding-right: 25px;
}
solved! i added this line and it fix it:
.child {
padding-right: 25px;
}

Bootstrap remove content: " "

I am using twitter bootstrap, and in the .row class, they add
content: " ";
How can I remove it from my application? It is adding a line to the edge of the screen. I have tried this:
.main-content .row{
content: "" !important;
}
But it doesn't work. If I use chrome and inspect the element and uncheck the box it fixes the issue. What can I do?
have you tried this?
EDIT: To remove clearfix completely changed to content: none;
.main-content .row:before,
.main-content .row:after {
content: none;
}
You're looking for content: none.

Resources