I created an unslider http://unslider.com/ using this HTML code
<div class="un-slider" dir="rtl">
<ul>
<li>
<div class="span6">
<blockquote class="testimonial">
<p>Hello world i m arbaz mateen. like a little programmer.</p>
</blockquote>
<div class="testimonial-arrow-down"> </div>
<div class="testimonial-author">
<img src="" border="0" width="50" height="50">
<p><strong>Huzaifa Khalid</strong><br><span>BSCS Student at Iqra University</span></p>
</div>
</div>
</li>
<li class="flex-active-slide" style="width: 100%; float: left; display: block;">
<div class="span6">
<blockquote class="testimonial">
<p>MeriTaleem helped me find the right information at the right time. I was looking for admission updates and wanted to know the process of how to apply for admissions.</p>
</blockquote>
<div class="testimonial-arrow-down"> </div>
<div class="testimonial-author">
<img src="" border="0" width="50" height="50">
<p><strong>Huzaifa Khalid</strong><br><span>BSCS Student at Iqra University</span></p>
</div>
</div>
</li>
and I get the this result
paragraph looks like this
CSS
blockquote.testimonial {
background: rgba(177,227,172,0.9);
color: #000;
font-family: Georgia, serif;
font-style: italic;
font-size: 1.2em;
line-height: 1.3;
width: 80%;
border-radius: 10px;
border: 0;
margin: auto;
padding: 10px 50px;
position: relative;
display: block;
}
blockquote.testimonial p {
margin: 15px;
width: 90%;
padding: 20px 50px 20px 20px;
}
blockquote.testimonial:before {
color: #000;
content: "\201C";
font-size: 80px;
font-style: normal;
padding-right: 15px;
float: left;
}
blockquote.testimonial:after {
content: "\201D";
color: #000;
font-size: 80px;
font-style: normal;
float: right;
margin-top: -60px;
}
I don't know what the problem is with <p> tag.
It appear as that because in your html dir="rtl" change it to ltr or just delete it
Your document have right to left text orientation and this is why there is dot in the beginning of the sentence. Your quotations are however in English and therefore should have left to right text orientation.
To achieve this add parameter dir="ltr" to both <blockquote>s.
Related
I have a div containing images and text with a background I added in CSS. Then I want a new div with text. The text keeps showing over the first div and nothing seems to work. I have read up on all the position options in CSS and more. I don't just want to move it down because I'm trying to make the website as responsive as possible.
MY HTML:
DIV 1:
<div id="carousel">
<div class="gallery">
<img src="images/img1.jpg">
<div class="desc"> Title </div>
</div>
<div class="gallery">
<img src="images/img2.jpg">
<div class="desc"> Title </div>
</div>
<div class="gallery">
<img src="images/img3.jpg">
<div class="desc"> Title </div>
</div>
<div class="gallery">
<img src="images/img1.jpg">
<div class="desc"> Title </div>
</div>
<div class="gallery">
<img src="images/img2.jpg">
<div class="desc"> Title </div>
</div>
<div class="gallery">
<img src="images/img3.jpg">
<div class="desc"> Title </div>
</div>
<p id="carouselhead"> YOUR BUILDING IS OUR BUSINESS </p>
<p id="carouseltext"> We offer the complete package to create your own wealth with property. <br>
We have the expertise to deliver excellent construction projects. <br>
We combine this with a willingness to make a difference & add value to your business.</p>
<div id="library"> SEE MORE </div>
</div>
DIV 2:
<div id="about">
<p id="abouthead"> ABOUT INCICON </p>
<p id="abouttext"> <u>InciCon has the skills and expertise to: </u><br><br>
Undertake development from concept to complete construction. <br>
Project Management turnkey projects - to your needs. <br>
Provide valuable input on cost-effective design & construction. <br>
Provide a competent Quantity Surveying service. <br>
Negotiate the most competitive rates. <br>
Source & Manage the most suitable suppliers & subcontractors. <br></p>
</div>
CSS:
DIV 1:
#carousel {
background-image: url(images/carouselbackground.jpg);
width: 92%;
position: absolute;
margin-top: 1%;
padding-left: 4%;
padding-right: 4%;
}
.gallery {
width: 14%;
margin-top: 4%;
margin-left: 1%;
margin-right: 1%;
display: inline-block;
}
.gallery img {
width: 100%;
height: auto;
}
.desc {
padding: 5%;
text-align: center;
font-family: 'Montserrat', sans-serif;
}
#carouselhead {
font-family: 'Open Sans', sans-serif;
font-size: 300%;
text-align: center;
font-weight: 800;
color: #456eb0;
}
#carouseltext {
font-family: 'Montserrat', sans-serif;
font-size: 100%;
text-align: center;
}
#library {
margin-top: 4%;
margin-bottom: 4%;
text-align: center;
}
#library a {
text-decoration: none;
color: black;
font-family: 'Open Sans', sans-serif;
font-weight: bold;
padding-top: 1%;
padding-bottom: 1%;
padding-left: 2%;
padding-right: 2%;
background-color: gray;
}
DIV 2:
#about {
position: relative;
background-color: white;
}
#abouttext {
text-align: center;
font-family: 'Montserrat', sans-serif;
font-size: 120%;
}
#abouthead {
text-align: center;
font-family: 'Open Sans', sans-serif;
font-size: 200%;
font-weight: 800;
color: #456eb0;
}
remove position:absolute
from #carousel in your css file.
remove position: absolute; from #carousel in your css file. be
#carousel {
background-image: url(images/carouselbackground.jpg);
width: 92%;
margin-top: 1%;
padding-left: 4%;
padding-right: 4%;
}
because, positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport, like fixed).
I have translated an image up to go behind a div to make it fit the design, however it leaves a white space below it, where the original image would be. How would I go about fixing this?
This is for a website, I've tried translating the sitemap up however then there is even more white space below the sitemap.
HTML:
<div class="portfolioImage" id="images">
<div class="portLogoImages" id="myDIV5">
<img src="./resources/portfolio/logoportfolio/logoPortfolio1.png" alt="" class="portfolioImages">
<img src="./resources/portfolio/logoportfolio/logoPortfolio2.png" alt="" class="portfolioImages">
<img src="./resources/portfolio/logoportfolio/logoPortfolio3.png" alt="" class="portfolioImages">
<img src="./resources/portfolio/logoportfolio/logoPortfolio4.png" alt="" class="portfolioImages">
<img src="./resources/portfolio/logoportfolio/logoPortfolio5.png" alt="" class="portfolioImages">
</div>
</div>
<div class="sitemap portAdjustment"> <!-- SITEMAP -->
<div class="sitemapItems">
<img src="./resources/sitemapLogo.png" alt="" class="sitemapLogo" width="166.3px" height="22px">
<div class="links">
<p >Home</p>
<p>Products</p>
<p>Portfolio</p>
<p>About Us</p>
<p>Contact Us</p>
</div>
<div class="finePrint">
<p>X is a part of the family company X that specialises in custom made design ranging from logo design to apparel design.</p>
<p>X</p>
</div>
</div>
</div>
CSS:
.portfolioImages {
border: none;
font-size: 0px;
transform: translateY(-25px);
max-width: 100%;
}
.portLogoImages {
border: none;
font-size: 0px;
transform: translateY(-25px);
max-width: 100%;
height: auto;
width: 100%;
margin-left: auto;
margin-right: auto;
}
.sitemap {
width: 100%;
height: 215px;
background-color: #f4f4f4;
padding: 30px 0px 30px 0px;
display: block;
text-align: center;
}
.finePrint {
padding-top: 70px;
color: #c8c8c8;
}
.sitemapItems {
padding: 0px 30px 0 30px;
display: block;
}
.sitemap a {
text-decoration: none;
color: #c8c8c8;
transition-duration: .2s;
display: inline-block;
padding-right: 4px;
}
.sitemap a:hover {
text-decoration: underline;
color: #434343;
}
I expect there to be no white space however there is still white space below it.
Just use margin-top instead transform
I want my email and the word 'email' to align on the right. I understand my email will be longer on the left.
<div style="margin: 0 auto; overflow: auto;">
<div style="background: #000; height: 80px; width: 100%; overflow: hidden;">
<h1 style="font-family: Snell Roundhand, cursive; padding-left: 10px; color: white; float: left;">New Trend Photography</h1>
<div>
<div>
<p style="font-size: 14px; color: white; float: right; padding-right: 10px;">E-mail</p>
</div>
<br>
<div>
<p style="font-size: 20px; color: white; float: right; padding-right: 10px;">newtrendphotography23#gmail.com</p>
</div>
</div>
</div>
</div>
Nest elements into one parent element, and declare positioning and alignment rules as needed to the parent element.
<div style="margin: 0 auto; overflow: auto;">
<div style="background: #000; height: 80px; width: 100%; overflow: hidden;">
<h1 style="font-family: Snell Roundhand, cursive; padding-left: 10px; color: white; float: left;">New Trend Photography</h1>
<div>
<div>
<p style="font-size: 14px; color: white; float: right; padding-right: 10px; max-width: 35%;">E-mail: newtrendphotography23#gmail.com</p>
</div>
</div>
</div>
</div>
You can achieve it in two ways.
Firstly put both of them in one paragraph with float:right.
You can use text-align: right; to the <p> to get them right aligned.
<div style="margin: 0 auto; overflow: auto;">
<div style="background: #000; height: 200px; width: 100%; overflow: hidden;">
<h1 style="font-family: Snell Roundhand, cursive; padding-left: 10px; color: white; float: left;">New Trend Photography</h1>
<p style="font-size: 14px; color: white; float: right; padding-right: 10px; max-width: 35%; text-align: right;">
E-mail:
<br> newtrendphotography23#gmail.com
</p>
</div>
</div>
Inside the <p> use a <span> with float: right on the "E-mail:", so that it floats to the right inside the paragraph that is floating to the right.
<div style="margin: 0 auto; overflow: auto;">
<div style="background: #000; height: 200px; width: 100%; overflow: hidden;">
<h1 style="font-family: Snell Roundhand, cursive; padding-left: 10px; color: white; float: left;">New Trend Photography</h1>
<p style="font-size: 14px; color: white; float: right; padding-right: 10px; max-width: 35%;">
<span style="float:right">E-mail: </span>
<br> newtrendphotography23#gmail.com
</p>
</div>
</div>
No.1 is the better solution as the text is by default left-aligned and that is what is causing the issue, not that the text is not floating to the right.
<div style="margin: 0 auto; overflow: auto;">
<div style="background: #000; height: 80px; width: 100%; overflow: hidden;">
<h1 style="font-family: Snell Roundhand, cursive; padding-left: 10px; color: white; float: left;">New Trend Photography</h1>
<div>
<div style="font-size: 14px; color: white; float: right; padding-right: 10px;text-align:right">
<p>E-mail</p>
<p>newtrendphotography23#gmail.com</p>
</div>
</div>
</div>
</div>
Add style to one div only
I am having trouble centring text relative to the width of my webpage, next to an image which is set to float to the left of the page.
Here is the HTML code:
<div class="header_img">
<img border="0" src="images/logo.png" alt="Home" width="200" height="35">
</div>
<div class="header">
HOMECONTACT
</div>
And here is the CSS code:
.header {
background:#000000;
font-size: 150%;
color: #666666;
font-family: ProximaNovaLight, Proxima Nova Light;
clear: both;
text-align: center;
display:inline;
}
.header_img {
float: left;
}
I am currently seeing the image floating to the left as I wanted, but the text (within the "header" class) is also floating to the left, next to the image.
Any help would be much appreciated!
Add this to your CSS:
.header { width: 40%; margin: 0 auto; }
and remove:
clear:both
display:inline
will give you:
.header_img {
float: left;
}
.header {
background:#000000;
font-size: 150%;
color: #666666;
font-family: ProximaNovaLight, Proxima Nova Light;
text-align: center;
margin: 0 auto;
width: 40%;
}
<div class="header_img">
<a href="index.php" class="head">
<img border="0" src="images/logo.png" alt="Home" width="200" height="35"/>
</a>
</div>
<div class="header">
HOMECONTACT
</div>
jsFiddle
Here is a way to do it without fixing the width of the .header. It is not clear where the background color (black) should be painted.
.header {
background:#000000;
font-size: 150%;
color: #666666;
font-family: ProximaNovaLight, Proxima Nova Light;
text-align: center;
display:block;
width: auto;
height: 35px; /* match image ? */
}
.header_img {
float: left;
}
<div class="header_img">
<img border="0" src="http://placehold.it/200x35" alt="Home" width="200" height="35">
</div>
<div class="header">
HOMECONTACT
</div>
I have tried tried coding a comment list where the avatar is supposed to display on the left, and the name and comment are supposed to display on the right. Any help solving the issue is appreciated.
Outcome
Desired Outcome
HTML
<section>
<div class='friend'>
<h3>John Smith</h3>
<p>Just another comment</p>
<img src='http://media.dunkedcdn.com/assets/prod/13/700x0-5_p17o72pss9bbmvuspb1gl61ot23.jpg'>
</div>
<div class='friend'>
<h3>John Smith</h3>
<p>Just another comment</p>
<img src='http://media.dunkedcdn.com/assets/prod/13/700x0-5_p17o72pss9bbmvuspb1gl61ot23.jpg'>
</div>
<div class='friend'>
<h3>John Smith</h3>
<p>Just another comment</p>
<img src='http://media.dunkedcdn.com/assets/prod/13/700x0-5_p17o72pss9bbmvuspb1gl61ot23.jpg'>
</div>
</section>
CSS
body {
font: 14px/20px 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #333;
}
a {
color: #333;
text-decoration: none;
}
h1, h2, h3 {
font-weight: 400;
}
h1 {
font-size: 30px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 20px;
}
img {
height: auto;
width: 100%;
}
section {
padding: 30px 60px;
}
.friend img {
height: 70px;
width: 100px;
display: block;
}
you would want to add float to your image
like
.friend img{
float:left;
}
here's a fiddle
Float your h3 and p tags to the right.
.friend h3, .friend p {
float: right;
}
Altneratively, have the image first and float it to the left.
http://css-tricks.com/all-about-floats/
https://developer.mozilla.org/en-US/docs/Web/CSS/float
I would recommend you to use inline-block instead of float in CSS with vertical-align, here you can see the result: http://jsfiddle.net/gG5uv/3/.
.friend img {
height: 70px;
width: 100px;
display: inline-block;
vertical-align: top;
}
.friend .data {
display: inline-block;
vertical-align: top;
}
I've also added a semantic separation between image and personal data of each item creating a div with class data.
Hey You can check your solution here at http://jsbin.com/edit/637/.
Just a few changes in your code.
HTML
<div class="friend">
<img id ='friend-image' src='http://media.dunkedcdn.com/assets/prod/13/700x0-5_p17o72pss9bbmvuspb1gl61ot23.jpg'>
<div id="friend-bio">
<h4>John Smith</h4>
<p>Just another comment</p>
</div>
</div>
<br>
<div class="friend">
<img id ='friend-image' src='http://media.dunkedcdn.com/assets/prod/13/700x0-5_p17o72pss9bbmvuspb1gl61ot23.jpg'>
<div id="friend-bio">
<h4>John Smith</h4>
<p>Just another comment</p>
</div>
</div>
<br>
<div class="friend">
<img id ='friend-image' src='http://media.dunkedcdn.com/assets/prod/13/700x0-5_p17o72pss9bbmvuspb1gl61ot23.jpg'>
<div id="friend-bio">
<h4>John Smith</h4>
<p>Just another comment</p>
</div>
</div>
and CSS
.friend #friend-image {
border: 1px solid #F0F2F8;
display: inline-block;
float: left;
height: 85px;
width: 84px;
}
#main #friend #friend-bio {
float: left;
font-size: 14px;
margin: -7px 0 0 20px;
width: 454px;
}
#main #friend #friend-bio h4 {
font-size: 18px;
font-weight: normal;
margin: 0 0 5px;
}