I want the text labeled
"I want this text aligned with the bottom widget
" to be aligned with bottom widget.
How do I achieve this? HTML ->
<div class="albums">
<iframe class="albumWidget" src="https://widgets.itunes.apple.com/widget.html?c=no&brc=FFFFFF&blc=FFFFFF&trc=FFFFFF&tlc=FFFFFF&d=&t=&m=music&e=album&w=325&h=370&ids=258634938&wt=discovery&partnerId=&affiliate_id=&at=10lumY&ct=" frameborder=0 style="overflow-x:hidden;overflow-y:hidden;width:325px;height: 370px;border:0px; display=inline;"></iframe>
<h3>Only Built 4 Cuban Linx (1995)</h3>
<p>
" Most cd's I buy, I get sick of in a few weeks or even days. However, this album is so perfectly balanced and groundbreaking that I get chills everytime I listen to it. When I listen to it, it just boggles my mind. " -- A customer
</p>
<p>
“ Beats by RZA are sharp like a razor. ” -- A. Sidletsky
</p>
</div>
<div class="albums">
<iframe class="albumWidget" src="https://widgets.itunes.apple.com/widget.html?c=no&brc=FFFFFF&blc=FFFFFF&trc=FFFFFF&tlc=FFFFFF&d=&t=&m=music&e=album&w=325&h=370&ids=328405814&wt=discovery&partnerId=&affiliate_id=&at=10lumY&ct=" frameborder=0 style="overflow-x:hidden;overflow-y:hidden;width:325px;height: 370px;border:0px;"></iframe>
<p>I want this text aligned with the bottom widget</p>
</div>
CSS ->
.albums {
}
iframe.albumWidget {
float:right;
clear: right;
margin-bottom: 20px;
}
Here's a link to website so you can have look http://raekwon.gteaay.com/discs-baby
Here's a link to a screenshot that shows the website the way I need it to be http://raekwon.gteaay.com
i do not know if this can help.. do check my fiddle
http://jsfiddle.net/ayiem999/HFs2k/
.albums {
}
iframe.albumWidget {
float:right;
clear: right;
margin-bottom: 20px;
}
p{
float:right;
clear: right;
margin-bottom: 20px;
}
<div class="albums">
<iframe class="albumWidget" src="https://widgets.itunes.apple.com/widget.html?c=no&brc=FFFFFF&blc=FFFFFF&trc=FFFFFF&tlc=FFFFFF&d=&t=&m=music&e=album&w=325&h=370&ids=258634938&wt=discovery&partnerId=&affiliate_id=&at=10lumY&ct=" frameborder=0 style="overflow-x:hidden;overflow-y:hidden;width:325px;height: 370px;border:0px; display=inline;"></iframe>
<h3>Only Built 4 Cuban Linx (1995)</h3>
<div>
" Most cd's I buy, I get sick of in a few weeks or even days. However, this album is so perfectly balanced and groundbreaking that I get chills everytime I listen to it. When I listen to it, it just boggles my mind. " -- A customer
</div>
<div>
“ Beats by RZA are sharp like a razor. ” -- A. Sidletsky
</div>
</div>
<div class="albums">
<iframe class="albumWidget" src="https://widgets.itunes.apple.com/widget.html?c=no&brc=FFFFFF&blc=FFFFFF&trc=FFFFFF&tlc=FFFFFF&d=&t=&m=music&e=album&w=325&h=370&ids=328405814&wt=discovery&partnerId=&affiliate_id=&at=10lumY&ct=" frameborder=0 style="overflow-x:hidden;overflow-y:hidden;width:325px;height: 370px;border:0px;"></iframe>
<p class="hi">I want this text aligned with the bottom widget</p>
</div>
This works! And it uses class (reusable, write once and apply class where needed), which the correct way to do it.
.albums {
position: absolute;
}
.reviews {
float: left;
height: 50%;
width: 50%;
}
.albumWidget {
height: 50%;
width: 50%;
float: left;
}
<section class="albums">
<section class="reviews">
<h3>Only Built 4 Cuban Linx (1995)</h3>
<p>
" Most cd's I buy, I get sick of in a few weeks or even days. However, this album is so perfectly balanced and groundbreaking that I get chills everytime I listen to it. When I listen to it, it just boggles my mind. " -- A customer
</p>
<p>
“ Beats by RZA are sharp like a razor. ” -- A. Sidletsky
</p>
</section>
<iframe class="albumWidget" src="https://widgets.itunes.apple.com/widget.html?c=no&brc=FFFFFF&blc=FFFFFF&trc=FFFFFF&tlc=FFFFFF&d=&t=&m=music&e=album&w=325&h=370&ids=258634938&wt=discovery&partnerId=&affiliate_id=&at=10lumY&ct=" frameborder=0 style="overflow-x:hidden;overflow-y:hidden;width:325px;height: 370px;border:0px;"></iframe>
<section class="reviews">
<h3>Only Built 4 Cuban Linx II (2009)</h3>
<p>" Raekwon's sound takes listeners back to gritty Shaolin of the 1990s; however, the production does not sound like leftover beats from that era. Instead, it is a fresh, new take on NYC street life and drama. " -- Intellectualista </p>
</section>
<iframe class="albumWidget" src="https://widgets.itunes.apple.com/widget.html?c=no&brc=FFFFFF&blc=FFFFFF&trc=FFFFFF&tlc=FFFFFF&d=&t=&m=music&e=album&w=325&h=370&ids=328405814&wt=discovery&partnerId=&affiliate_id=&at=10lumY&ct=" frameborder=0 style="overflow-x:hidden;overflow-y:hidden;width:325px;height: 370px;border:0px;"></iframe>
</section>
Related
i am making a website for school. The images need to float right with some <p> text to left of it but cant make it work. Who can help me, see img for clearence. Here is some code:
.img-inno {
float: right;
height: 10%;
width: 10%;
text-align: left;
}
<header class="inno"> Innovation 1, Running
</header>
<p> One of the best sporting technoligies out is a treadmill to determine which running shoes you need. </p>
<p> You will walk a couple of 100 meters and a screen will show how you place you foot in the shoes you have tested. </p>
<p> Based on that you can choose new choes and will determine again if the shoes fit. </p>
Eventually you will have some good data which shoes will fit the best. The data will be sent via email.
<footer>
<p> These shops are everywhere! In the USA and The Netherlands, you name it! </p>
More info? Click here
</footer>
<a href="https://21run.com/eu/">
<img class="img-inno" id="img1" src="https://hips.hearstapps.com/hmg-prod/images/male-athlete-running-on-tartan-track-royalty-free-image-1624297569.jpg?crop=0.670xw:1.00xh;0.245xw,0&resize=640:*" alt="Running, copyright belongs to runner's world">
</a>
</article>
<article>
<header class="inno"> Innovation 2, Bowling
</header>
<p>This one could be a little bit silly, but it is a good innovation. I am talking about the Computerized Scoring Bowling.</p>
<p> A computer will focus on the score, while you can focus on the bowling aspect and don't have to count your scores. </p>
<p>These small innovations have a impact about our daily life without you aven noticing.</p>
<footer>
Fun Fact: The risk of a false score went down drasticly after this invention.
Make a reservation for bwoling here.
</footer>
<a href="https://www.etsy.com/nl/listing/1052730525/aangepaste-airbrushed-bowling-ball?gpla=1&gao=1&">
<img class="img-inno" src="https://cdn.bleacherreport.net/images_root/slides/photos/000/995/723/83452843_display_image.jpg?1307417974" alt="Bowling, Copyright belongs to bleacherreport.com">
</a>
</article>
As c.m. noted it is better to do it with CSS Flexbox.
Check out the following example to get an idea of how it works.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
article {
display: flex;
justify-content: space-between;
/*flex-wrap: wrap;
Use this if you want the images to wrap under the text for smaller screen sizes*/
}
.left {
flex-grow: 3;
flex-shrink: 1;
flex-basis: auto;
}
.right {
flex-grow: 1;
flex-shrink: 1;
flex-basis: auto;
}
.img-inno {
max-width: 200px;
width: 100%;
}
</style>
<title>Document</title>
</head>
<body>
<article>
<div class="left">
<header class="inno">
Innovation 1, Running
</header>
<p> One of the best sporting technoligies out is a treadmill to determine which running shoes you need. </p>
<p> You will walk a couple of 100 meters and a screen will show how you place you foot in the shoes you have tested. </p>
<p> Based on that you can choose new choes and will determine again if the shoes fit. </p>
<p>Eventually you will have some good data which shoes will fit the best. The data will be sent via email.</p>
<footer>
<p> These shops are everywhere! In the USA and The Netherlands, you name it!</p>
<p> More info? Click here</p>
</footer>
</div>
<div class="right">
<a href="https://21run.com/eu/">
<img class="img-inno" id="img1" src="https://hips.hearstapps.com/hmg-prod/images/male-athlete-running-on-tartan-track-royalty-free-image-1624297569.jpg?crop=0.670xw:1.00xh;0.245xw,0&resize=640:*" alt="Running, copyright belongs to runner's world">
</a>
</div>
</article>
<article>
<div class="left">
<header class="inno">
Innovation 2, Bowling
</header>
<p>This one could be a little bit silly, but it is a good innovation. I am talking about the Computerized Scoring Bowling.</p>
<p> A computer will focus on the score, while you can focus on the bowling aspect and don't have to count your scores. </p>
<p>These small innovations have a impact about our daily life without you aven noticing.</p>
<footer>
Fun Fact: The risk of a false score went down drasticly after this invention.
Make a reservation for bwoling here.
</footer>
</div>
<div class="right">
<a href="https://www.etsy.com/nl/listing/1052730525/aangepaste-airbrushed-bowling-ball?gpla=1&gao=1&">
<img class="img-inno" src="https://cdn.bleacherreport.net/images_root/slides/photos/000/995/723/83452843_display_image.jpg?1307417974" alt="Bowling, Copyright belongs to bleacherreport.com">
</a>
</div>
</article>
</body>
</html>
Use CSS Flexbox
That is the html code
<article>
<p>Text</p>
<img src=""/>
</article>
and that css
article {
width: 500px;
display: flex;
}
then you can put spacing with margin and padding on your p or img and you can align your content, too
don't use float anymore, that's not modern coding style
read more about flexbox, there is a nice guide at css-tricks.com
I am trying to get the div with div class bioDiv to line up under the image but have tried so many things that I am just getting more and more confused can anyone look at the code for me and give me a clue? Looking to keep the same look just move the div to a more central location.
here is the code:
body {
width: 100%;
height: auto;
background-image: url("../img/marble-background.gif");
background-size: 100% 100vh;
}
img {
border: 10px solid #E3C640;
}
.menuDiv {
background-color: white;
height: 850px;
width: 300px;
margin-top: 70px;
border: 15px solid #E3C640;
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 30px;
}
.bioDiv {
background-color: white;
height: 850px;
width: 1200px;
border: 15px solid #E3C640;
position: relative;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Welcome to Cary McClures' Portfolio</title>
<style type="text/css">
#import url("bootstrap-5.1.3-dist/css/bootstrap.css");
</style>
</head>
<head>
<body>
<img style="position: absolute; right: 600px; top: 68px
" src="../img/images/me.jpg" width="400" height="600" alt="picture of cary" />
<div class="menuDiv">
<h2 style="color: goldenrod">Home</h2>
<br>
<h2 style="color: goldenrod">Biography</h2>
<br>
<h2 style="color: goldenrod">Education</h2>
<br>
<h2 style="color: goldenrod">Graphic Design</h2>
<br>
<h2 style="color: goldenrod">Freelance</h2>
<br>
<h2 style="color: goldenrod">Baking</h2>
<br>
<h2 style="color: goldenrod">Photo Gallery</h2>
<br>
<h2 style="color: goldenrod">Resume</h2>
<br>
<h2 style="color: goldenrod">Contacts</h2>
<br>
<h2 style="color: goldenrod">Sitemap</h2>
</div>
<div class="bioDiv">
<br>
<h2 style="color: goldenrod">Biography</h2>
<p>Cary L. McClure is an enthusiastic Geneva-based Educator, Culinary Artist, Graphic Designer, and Overachiever with a decade-long background in leadership and customer service.
</p>
<br>
<p>Hailing from Indianapolis originally, Cary’s avid interest in the graphic arts started while he was in high school back in 1983. Unable to attend college, he wound up in the food industry.
</p>
<br>
<p>After working as a Pastry Chef for several years, Cary ultimately has had to alter his career path, due a disability he endured during his time in the military.
</p>
<br>
<p>Currently Cary has been working as a Substitute teacher (K-12) for Adams Central and South Adams Schools.
</p>
<br>
<p>Cary served as an Adjunct Instructor at Ivy Tech Community College, where he taught students about Cakes, Filling and Icings, Wedding Cake Production, and Classical Pastries.
</p>
<br>
<p>In 2019 Cary obtained his bachelor’s degree in Visual Communication (Graphic Design) from Indiana University. Furthermore, he holds an Associates of Applied Science degree (with honors) in Hospitality & Culinary Pastry Arts from Ivy Tech.
</p>
<br>
<p>Outside of his career, Cary L. McClure enjoys reading fantastical books, PS4 and Xbox One gaming, and crafting gum-paste flowers. An avid traveler, he also loves exploring new places and is seeking a position that will allow him to travel across
the country. Above all, he cherishes spending quality time with his family. He is the proud father of one married son.
</p>
<br>
</div>
</body>
</head>
</html>
I would suggest making two containers (an aside and a main) and put the navigation list in the aside and the image and bio in the main. Something like this:
.container {
display: flex;
}
<div class="container">
<aside>
<h1>Put your nav here</h1>
</aside>
<main>
<img src="" height="200" width="300" />
<div>
<h1>Put Bio here</h1>
</div>
</main>
</div>
PS: In case you didn't know, aside and main are semantic HTML5 tags used to markup a page. You can use divs instead of them, but it's not best practice
In Bootstrap you do not have to dictate the widths etc, it can all be done using standard Bootstrap CSS which you dictate as a class= in your HTML. So, for the image you could have that fluid inside a column.
<div class="col-sm-12 col-md-10 mx-auto">
<img src="../img/images/me.jpg" class="img-fluid" alt="picture of cary"/>
</div>
That's full width (12 wide) on small screens and not quite full width (10 wide) on anything larger but mx-auto should center the entire Div. Setting the image to class img-fluid makes it the full width of the Div no matter the screen.
Hopefully after that you can use exactly the same column set up for .bioDiv.
<div class="col-sm-12 col-md-10 mx-auto">
<h2 style="color: goldenrod">Biography</h2>
continued content here....
</div>
Ultimately you are just wrapping the image in a Div and setting both it and bioDiv to the same column parameters. It should not hurt in any way to set up menuDiv a similar way.
My web page won't scroll on mobile devices. It works if you resize the window on desktop, but if you view the page on an actual mobile device then there is no ability to scroll. This is causing only half of the page's content to be visible.
I've tried setting the body height to 100%.
* {margin: 0; padding: 0, box-sizing: border-box;}
.news-module {
width: 100%;
float: left;
height: auto;
}
.news-sub-module {
width: 70vw;
height: auto;
margin: 2vw 5vw 3vw 5vw;
padding: 4vw;
float: left;
color: black;
cursor: pointer;
}
.news-sub-module:nth-child(even) {
float: right;
}
.header-style-one {
width: 100%;
}
.news-more {
float: left;
margin: 1vw 0 0 0;
}
<div class="news-module">
<div class="news-sub-module">
<div class="news-date">
06.12.2019 </div>
<div class="header-style-one">
Meet Italy’s Most Passionate Tomato Farmer
</div>
<div class="news-description">
August in Italy: businesses are closed, cities have emptied out, towns are deserted—everyone is at the beach. Everyone, that is, except for tomato farmers in the Campania region, Italy’s tomato capital. Here, in late summer, trucks loaded with the vibrant, just-harvested fruits crowd tiny, one-lane streets...
</div>
<div class="news-more">
→ Read More
</div>
</div>
<div class="news-sub-module">
<div class="news-date">
06.11.2019</div>
<div class="header-style-one">
Q+A with Winemaker Steve Matthiasson
</div>
<div class="news-description">
Steve Matthiasson was perhaps the most in-demand viticulturist in Napa when he and his wife, Jill, decided to start their own wine label. We caught up with Steve in the middle of this year’s grape harvest to talk about one of his favorite subjects: gathering friends to eat, drink and be merry...
</div>
<div class="news-more">
→ Read More
</div>
</div>
<div class="news-sub-module">
<div class="news-date">
05.15.2019 </div>
<div class="header-style-one">
Spring’s Most Sensitive, and Bountiful, Vegetable
</div>
<div class="news-description">
“People say gambling came to New Jersey with the casinos,” laughs Tom Sheppard of Sheppard Farms in Cumberland County, New Jersey. “But gambling came with the first farmers. Out there in the field, mother nature can do all kinds of things to you.”...
</div>
<div class="news-more">
→ Read More
</div>
</div>
<div class="news-sub-module">
<div class="news-date">
05.10.2019 </div>
<div class="header-style-one">
Can an American Parmesan Dethrone the King of Cheeses?
</div>
<div class="news-description">
Parmesan cheese is at the heart of Italian cuisine, and the greatest of all of Parmesans is Parmigiano Reggiano. So when you’re looking for a cheese to grate over a saucy tangle of pasta, there is no substitute. The Schuman family believes they can change all that...
</div>
<div class="news-more">
→ Read More
</div>
</div>
</div>
I want the ability to scroll on mobile instead of having the content getting cut off.
I have a box that contain some text and another box that contain a video.
Here's the jsfiddle
Codes:
CSS:
.bluebox{
background-color: #1EAECE;
}
.orangebox{
background-color: #FF8800;
}
HTML:
<div style="margin-top: -13px;">
<div class="bluebox" style="display: table-cell;width: 52.2%;">
<div class="title">Usage</div>
<ul>
<li>Moisten with warm water to activate the ingredients.</li>
<li>Apply the bar directly on face & body.</li>
<li>Massage the creamy texture into your skin.</li>
<li>Allow the emulsion time to permeate into the skin.</li>
<li>Rinse off.</li>
</ul>
<p>Suitable for Face wash, Body wash, Shaving, Sensitive areas, Intimate parts, Shower & Bath.</p>
</div>
<div style="display: table-cell;width: 0.7%;"></div>
<div class="orangebox" style="display: table-cell;width: 47.3%;">
<video width="418" src="http://brexes.com/Images%20and%20Videos/GamilaSecretVideo.mp4" controls></video>
</div>
</div>
The first box that contain text have a huge space on the top, I want to remove this space and set the two divs in the same line.
So here's how it looks like:
Here's how it should be like:
Add a basic:
vertical-align: top;
to your class ".bluebox"
i'm a little rusty on html and css and i cant get 2 images to float, one on top of the other. heres the code...
<div class="kbody">
<img class="kimg1" src="img1.jpg" alt=" " width="375px" height="auto">
<div id="ktxt">
<p>          
Kristallnacht occurred on November 9-10, 1938. Also known as the night of
broken glass, it was an organized attack on the Jews. Hitler had Nazis all over
Germany and Austria that burned synagogues, broke store windows, stole from the
stores, killed a couple dozen Jews, and arrested twenty thousand more. A few days
later Germany made an "atonement fine" that added up to over one billion dollars
and placed it on the remaining Jews. </p>
</div>
<img class="kimg2" src="img3.jpg" alt=" " width="375px" height="auto">
</div>
and the css...
.kbody {
width:800px;
margin-left: auto;
margin-right: auto;
/*border-style:solid;
border-width:3px;*/
}
.kimg1 {
padding-left:5px;
padding-top:5px;
padding-bottom:5px;
float:left;
}
.kimg2 {
padding-left:5px;
padding-top:5px;
padding-bottom:5px;
float:left;
margin-top:10px;
}
#ktxt {
padding-left:10px;
padding-right:10px;
padding-top:10px;
/*border-width:2px;
border-style: solid;*/
width:350px;
height:330px;
margin-left:402px;
font-style:arial, sans-serif;
color: #336699;
font-size:14pt;
}
what am i doing wrong??
heres what it looks like with this code
http://imgur.com/a/ivDE2#0
To move the second image under the first:
.kimg2 {
clear: both;
}
<div class="kbody">
<img class="kimg1" src="img1.jpg" alt=" " width="375px" height="auto">
<div id="ktxt">
<p>          
Kristallnacht occurred on November 9-10, 1938. Also known as the night of
broken glass, it was an organized attack on the Jews. Hitler had Nazis all over
Germany and Austria that burned synagogues, broke store windows, stole from the
stores, killed a couple dozen Jews, and arrested twenty thousand more. A few days
later Germany made an "atonement fine" that added up to over one billion dollars
and placed it on the remaining Jews. </p>
</div>
<img class="kimg2" src="img3.jpg" alt=" " width="375px" height="auto">
<div style="clear:both"></div>
</div>
Put a clearfix between the elements you want to show them in separate lines. I would write a global css rule like .clearfix { clear: both; } and put a div before the second image;
Instead of writing bunch of use CSS text-indent property;
Sample Code:
<div class="kbody">
<img class="kimg1" src="img1.jpg" alt=" " width="375px" height="auto">
<div id="ktxt">
<p>
Kristallnacht occurred on November 9-10, 1938. Also known as the night of
broken glass, it was an organized attack on the Jews. Hitler had Nazis all over
Germany and Austria that burned synagogues, broke store windows, stole from the
stores, killed a couple dozen Jews, and arrested twenty thousand more. A few days
later Germany made an "atonement fine" that added up to over one billion dollars
and placed it on the remaining Jews.
</p>
</div>
<div class="clearfix"></div>
<img class="kimg2" src="img3.jpg" alt=" " width="375px" height="auto">
</div>
try to wrap your image
html
<div class="kbody">
<div class="imageWrapper">
<img class="kimg1" src="img1.jpg" alt=" " width="375px" height="auto" />
<img class="kimg2" src="img3.jpg" alt=" " width="375px" height="auto" />
</div>
<div id="ktxt">
<p>          
Kristallnacht occurred on November 9-10, 1938. Also known as the night of
broken glass, it was an organized attack on the Jews. Hitler had Nazis all over
Germany and Austria that burned synagogues, broke store windows, stole from the
stores, killed a couple dozen Jews, and arrested twenty thousand more. A few days
later Germany made an "atonement fine" that added up to over one billion dollars
and placed it on the remaining Jews. </p>
</div>
</div>
css
.imageWrapper {
float:left;
width:375px;
}
hope this help you
easier way is <img src="yourimage.jpg" align="left" />
As you want your picture to be floated to left side is not possible as you do. So, you should define your html alternatively for what you want as..
<div class="kbody">
<div class="kimg">
<img ..image1../>
<img ..image2../>
</div>
<div id="ktext">your text...</div>
</div>
Now define the css.
hints:
.kimg{width: 300px;}
#ktext{width: 300px;}