I have a three column markup for which the middle column #palette( elastic column) has following innerHTML markup snippet
<div id="palette">
<div id="wrapper" style="left: -354px; top: 0px;">
<div id="colours">
<ul>
<li class="swatch"><a tite="Beige" style="background-color:beige;" class="label" href="javascript:void(0);"><span> </span></a></li>
<li class="swatch"><a tite="Bisque" ... class="label" href="javascript:void(0);"><span> </span></a></li>
<li class="swatch"><a tite="Brown" style="background-color:brown;" class="label" href="javascript:void(0);"><span> </span></a></li>
<li class="swatch"><a tite="Coral" style="background-color:coral;" onclick="setColouringColour(this);" class="label" href="javascript:void(0);"><span> </span></a></li>
....
</ul>
</div>
<div id="brush-sizes"> <span style="width:16px; height:16px;" ><span>16</span></a></span> <span class="brush badge" style="width:32px; height:32px;"><a...><span>32</span></a></span> <span class="brush badge" style="width:64px; height:64px;"><a...><span>64</span></a></span> </div>
<div id="brushes"> <a class="selected btn btn-mini"...> </a> <a class="btn btn-mini"> </a> </div>
</div>
Where the following CSS rules apply
#palette {
float: left;
height: 100%;
position: relative;
width: 100%; overflow:hidden;
}
#wrapper {
display: inline-block;
position: absolute;
top: 0 !important;
white-space: nowrap;
width: auto;
}
Note: #palette is overflow:hidden so that #wrapper can be
scrolled using left:*n*px;. The children inside
#wrapper are all display:inline-block; clear:none;
The problem I am having is that #wrapper is not at "full width" of its children...thus I can't seem to be able to scroll to the very end.
What is the source of the problem here and how can I fix it using CSS ONLY( can it be accomplished CSS only?)
Apparently I needed to set one of the 2 remaining < div > to a fixed width and also tried setting the max- and min- width appropriately. Don't know why that worked
Related
At this site, there is a div.social below the Online Bookings at top right of the screen.
http://imgur.com/a/QhlIL
Note: I've not been able to upload images to SO for months - always says the image is too large (> 2MB) when it is 140 KB.
For some reason .social is not displaying, nor its sub-elements:
<div class="social">
<a title="Trip Advisor" href="#" target="_blank">
<div class="tripAdvisor"></div>
</a>
<a title="Facebook" href="#" target="_blank">
<div class="facebook"></div>
</a>
<a title="Instagram" target="_blank" href="#">
<div class="instagram"></div>
</a>
<a title="YouTube" target="_blank" href="#">
<div class="youtube"></div>
</a>
</div>
<style>
.headRight .tripAdvisor {
background: url(../images/social/tripadvisor.png) no-repeat;
width: 28px;
height: 22px;
}
</style>
.social is set to display: block; and there is enough room to fit the icons in.
Help appreciated.
Just checked the bug on your website.
You must apply the style to the child divs of .social
.social div {
display: inline-block;
margin-right: 15px;
display: inline; // remove this line
zoom: 1;
}
remove the
"display: inline"
Just keep
.social div {
display: inline-block;
margin-right: 15px;
zoom: 1;
}
from that class. Will work perfectly.
I'm using Bootstrap Application theme and I have a media-list where in media-body the text is users' input....
Unfortunately if a user inputs a very long word the page breaks and a horizontal scrollbar appears...
I tried setting max-width & width to 100% in body and have tried different word-wrapping techniques on the element including:
white-space:pre-wrap;
word-wrap: break-word;
white-space: pre-line;
overflow: hidden;
display: block;
but no luck... any idea on why is word-wrapping not working?
Thanks a lot
in CSS:
body {
margin: 0;
max-width: 100%;
padding-top: 50px;
padding-bottom: 20px;
}
in page (some code changed for security)
<ul class="list-group media-list media-list-stream">
<li id="43434" class="media list-group-item p-a">
<div class="media-body">
<span style="padding-bottom: 5px;" class="pull-right close" onclick="Delete();return false;" aria-hidden="true">×</span>
<span style="white-space: pre-wrap;">text</span><br/>
<small class="text-muted"><span data-utcdate="date"></span></small>
</div>
</li>
</ul>
<header>
<div class="row header-top">
<div class="row-inner">
<a href="/test1/" class="testxyz">
<i class="icon icon-test"></i>
<i icon-color="" class="icon icon-test" ng-style="{color: color}" style="color: rgb(51, 191, 238);"></i>
</a>
<div class="header-here">
<span>here</span>
<ul class="header-here-list">
</ul>
</div>
</div>
</div>
<span ng-controller="CNController" class="ng-scope">
<div class="row header-nav">
<div class="row-inner">
</div>
</div>
</span>
</header>
I'm trying to position div with class lb-ad-test the same as the div with class row header-top. I tried adding position: relative to the div with class row header-top and then added position: absolute to the div with class lb-ad-test and set top & right to 0, but the content in div does not show up when I do that. How can I place the content in the
below div same as the div with class row header-top?
<div ng-view="" class="app-container ng-scope">
<div id="lb-test" class="lb-ad-test ng-scope ng-isolate-scope" >
</div>
</div>
CSS:
.header-top {
background: #2b2b2b;
height: 93px;
position: relative;
}
.lb-ad-test {
position: absolute;
padding-bottom: 40px;
padding-top: 40px;
left: 0px;
right: 0px;
margin: 0 auto;
}
Change .leaderboard-ad-homepage in the CSS to .lb-ad-test? Your class names currently don't match.
You may try to set one class with left=0 and top = 0.
I have three images, the firsts are the brazilian flag and the english flag (language settings).. and the third is the logo of my site...
code:
<a class="language" href=""><img src="assets/images/language/portuguese.png">Português</a>
<a class="language" href=""><img src="assets/images/language/english.png">English</a>
<img class="logo" src="assets/images/logo.png">
I want the first and the second above the third..
So, in my css i made:
.language {
margin: 0 5px 0 10px;
}
.logo {
width: 40%;
margin-top: 60px;
}
There is something wrong?? it's not working.
At the moment you have all three images in the same "row". You didn't separate them in two rows in any way.
I would suggest putting language icons in their own div tag like this:
<div>
<a class="language" href=""><img src="assets/images/languag/portuguese.png">Português</a>
<a class="language" href=""><img src="assets/images/language/english.png">English</a>
</div>
<img class="logo" src="assets/images/logo.png">
More information missing from your question, but I guess that's it
<style type="text/css">
.classe1 {
background-image: url('../../Content/images/carousel2.jpg');
background-repeat: no-repeat;
height:100px;
}
</style>
<div class="classe1">
<img src="../../Content/images/Icon1.png" alt="" width="40px" />
<img src="../../Content/images/Icon2.png" alt="" width="40px" />
</div>
If you can't influence the HTML, you can make <br> with CSS:
a + a:after {
content: "\A";
white-space: pre;
}
Since ::before and ::after don't work on self closing tags like <img>, you'll have to add it to the second <a>
Voila demo
Just make it like this
HTML
<div class="wrapit">
<a class="language" href=""><img src="assets/images/language/portuguese.png">Português</a>
<a class="language" href=""><img src="assets/images/language/english.png">English</a>
<img class="logo" src="assets/images/logo.png">
</div>
CSS
.wrapit {
width: 100px;
float: left;
}
.wrapit img { width: 100%; float: left; }
.wrapit a { float: left; width: 50%; display: block; }
I have a page that displays a span and an image, the idea is that the span appears above the image so that the image appears behind the transparent parts of the text: http://www.luckysaddleupholstery.com.
The webpage is fairly simple:
<body>
<div id="content" >
<div id="nav">
<ul id="pages">
<li class="selected">
LUCKY SADDLE</li>
<li >
designs</li>
<li >
info</li>
<li >
contact</li>
</ul>
<ul id="subpages">
</ul>
<div id="layoutItem40" class="layoutItem textItem titleText" style="left: 0px; top: 196px; width: 556px;"><span style="font-size: 42px; line-height: 42px; color: #B84C59;">VINTAGE. MODERN. TRADITIONAL. BY HAND. STUFFING. HIERLOOM. nostalgic. shabby. recycle. textiles. worn. forgotten. spring. unique. restore. </span>
</div>
<img id="logo" src="/static/img/logo.png"/>
<div id="contact"><strong>T</strong> 07961 706 522<br /><span><strong>E</strong> ruth#luckysaddleupholstery.com</span>
</div>
</div>
<div id="bodyWrapper" style="top: 14px; position: absolute;">
<div id="body" style="position: relative;">
<div id="layoutItem49" class="layoutItem imageItem" style="left: 288px; top: 0px; width: 748px;">
<img src='/static/media/imgs/Richard-Moore-Chair-Main.jpg' />
</div>
</div>
</div>
</div>
</body>
</html>
The relevant parts of the css:
.layoutItem {
position: absolute;
margin-top: 3px;
margin-left: 1px;
}
.textItem span {
z-index: 10;
margin-top: 2px;
position: relative;
}
.imageItem img {
z-index: 1;
position: relative;
}
#nav {
width: 172px;
height: 100%;
top: 0px;
position: fixed;
padding-left: 1px;
}
There is more css that effects the elements and their parents but this is all text styling, rather than positioning.
The concept is that the large text in the nav column overlays the body div - which contains the image, allowing the image to be scrolled underneath.
The image and text are rendered from a CMS system which is why the html is slightly convoluted, although very customisable!
The renders fine in Firefox, but recently seems to have become broken in recent versions of Safari / Webkit.