Removing space between images - html

imageI have a block of images but they are not connected to one another, I need to remove the spaces and make them looked attached. I have tried the following but doesn't work
img {
border: 0 none;
box-shadow: none;
padding:0px;
float: left;
display:block;
float:left;
line-height:0;
}
This is my html
<div class="col-xs-4 col-md-3 ">
<div class="hovereffect">
<img src="images/plasma.jpg" alt="Plasma" id="space">
<div class="overlay">
<h3>
Creativity on Combined Photos
</h3>
<p>
LINK HERE
</p>
</div>
</div>
</div>
Please see the image where the problem is.

.test{
display:flex
}
<div class="test">
<div class="hovereffect">
<img src="http://placehold.it/350x150">
<div class="overlay">
<h3>
Creativity on Combined Photos
</h3>
<p>
LINK HERE
</p>
</div>
</div>
<div class="hovereffect">
<img src="http://placehold.it/350x150">
<div class="overlay">
<h3>
Creativity on Combined Photos
</h3>
<p>
LINK HERE
</p>
</div>
</div>
</div>
is it something like this you are looking for?
I did this with flexbox you just give the parent of the images display:flex;
if you not want them one next to each other you can do it this way
.test{
display:flex;
flex-direction:column
}
.hovereffect{
display:flex;
}
<div class="test">
<div class="hovereffect">
<img src="http://placehold.it/350x150">
<div class="overlay">
<h3>
Creativity on Combined Photos
</h3>
<p>
LINK HERE
</p>
</div>
</div>
<div class="hovereffect">
<img src="http://placehold.it/350x150">
<div class="overlay">
<h3>
Creativity on Combined Photos
</h3>
<p>
LINK HERE
</p>
</div>
</div>
</div>

Please try this:
img {
border: 0 none;
box-shadow: none;
padding:0px;
float: left;
display:block;
margin:0;
line-height:0;
}

Related

Responsive design to align Items in div to the center of the page using HTML and CSS

[Output Image I'm getting
.featuress{
width:70%;
margin-left:20%;
display: flex;
align-items: center;
padding-bottom:30px;
}
.logo{
min-width: 60px;
margin:10px;
text-align:center;
}
.text{
display: inline-block;
background-color: #ffa600;
}
body, h2, p {
margin:0;
}
.featuress{
width:70%;
margin-left:20%;
display: flex;
align-items: center;
padding-bottom:30px;
}
.logo{
min-width: 60px;
margin:10px;
text-align:center;
}
.text{
display: inline-block;
background-color: #ffa600;
}
body, h2, p {
margin:0;
}
<div class="featuress">
<section id="features">
<div class="premium">
<div class="logo1">
<img class="logo" src="https://cdn-icons-png.flaticon.com/512/70/70535.png" width="40" alt="premium" />
</div>
<div class="text text1">
<h2>Premium Materials</h2>
<p>Our trombones use the shiniest brass which is sourced locally. This will increase the longevity of your purchase.</p>
</div>
</div>
<div class="shipping">
<div class="logo2">
<img class="logo" src="https://cdn.pixabay.com/photo/2020/09/14/20/39/vans-5572117__480.png" alt="shipping" width="60" />
</div>
<div class="text text2">
<h2>Fast Shipping</h2>
<p>We make sure you recieve your trombone as soon as we have finished making it. We also provide free returns if you are not satisfied.</p>
</div>
</div>
<div class="quality">
<div class="logo3">
<img class="logo loggo3" src="https://i.pinimg.com/736x/0b/a2/d1/0ba2d192c9b874a4df11af1a90a6d1ad.jpg" alt="quality" width="60"/>
</div>
<div class="text text3">
<h2>Quality Assurance</h2>
<p>For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.</p>
</div>
</div>
</section>
</div>
][1]Intended Output Style
<div class="featuress">
<section id="features">
<div class="premium">
<div class="logo1">
<img class="logo" src="https://cdn-icons-png.flaticon.com/512/70/70535.png" width="40" alt="premium" />
</div>
<div class="text text1">
<h2>Premium Materials</h2>
<p>Our trombones use the shiniest brass which is sourced locally. This will increase the longevity of your purchase.</p>
</div>
</div>
<div class="shipping">
<div class="logo2">
<img class="logo" src="https://cdn.pixabay.com/photo/2020/09/14/20/39/vans-5572117__480.png" alt="shipping" width="60" />
</div>
<div class="text text2">
<h2>Fast Shipping</h2>
<p>We make sure you recieve your trombone as soon as we have finished making it. We also provide free returns if you are not satisfied.</p>
</div>
</div>
<div class="quality">
<div class="logo3">
<img class="logo loggo3" src="https://i.pinimg.com/736x/0b/a2/d1/0ba2d192c9b874a4df11af1a90a6d1ad.jpg" alt="quality" width="60" />
</div>
<div class="text text3">
<h2>Quality Assurance</h2>
<p>For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.</p>
</div>
</div>
</section>
</div>
This is the HTML bit of the code I tried writing and the intended format I was looking for is attached along. I just cant quite get it the way its shown. It'd be really helpful if I could be helped with how to align and style just this part of the site using CSS
You can use display:flex and align-items:center on your features. I added some style to fit a little bit like your screen.
body, h2, p {
margin:0;
}
.feature {
display:flex;
align-items: center;
padding-bottom:30px;
}
.logo{
min-width: 60px;
margin:10px;
text-align:center;
}
<div class="feature">
<div class="logo">
<img src="https://cdn-icons-png.flaticon.com/512/70/70535.png" width="40"/>
</div>
<div>
<h2>Premium Materials</h2>
<p>Our trombones use the shiniest brass which is sourced locally. This will increase the longevity of your purchase.</p>
</div>
</div>
<div class="feature">
<div class="logo">
<img src="https://cdn.pixabay.com/photo/2020/09/14/20/39/vans-5572117__480.png" width="60" />
</div>
<div>
<h2>Fast Shipping</h2>
<p>We make sure you recieve your trombone as soon as we have finished making it. We also provide free returns if you are not satisfied.</p>
</div>
</div>
<div class="feature">
<div class="logo">
<img src="https://i.pinimg.com/736x/0b/a2/d1/0ba2d192c9b874a4df11af1a90a6d1ad.jpg" width="60" />
</div>
<div>
<h2>Quality Assurance</h2>
<p>For every purchase you make, we will ensure there are no damages or faults and we will check and test the pitch of your instrument.</p>
</div>
</div>
EDIT
Here is an exemple of what to select with display:flex, take a look at Flexbox (MDN).
.container{
border:1px solid black;
}
.d-flex{
display:flex;
}
.orange{
background-color:orange;
}
.green{
background-color:green;
}
.pink{
background-color:pink;
}
<div class="d-flex container">
<div class="box-container orange">
<div class="box">A</div>
<div class="box">B</div>
<div class="box">C</div>
</div>
<div class="box-container green">
<div class="box">D</div>
<div class="box">E</div>
<div class="box">F</div>
</div>
<div class="d-flex box-container pink">
<div class="box">G</div>
<div class="box">H</div>
<div class="box">I</div>
</div>
</div>

Align 2 classes with the same name horizontally

Doing the MIMO HTML course and I've come across an issue where i cant get both elements with the class="column" attribute to align horizontally with display: inline-block;
I've already tried float:right and other properties to make them line up but something is stopping this happening
.column {
min-width: 300px; /*DOES NOT WORK*/
display: inline-block; /*DOES NOT WORK*/
vertical-align: top; /*DOES NOT WORK*/
}
<div id="footer">
<!--Footer-->
<div class="container">
<div class="column">
<h4>My Links
<!--My Links Header-->
</h4>
<p>
<a href="https://soundcloud.com/discover">Soundcloud <!--Link-->
</a>
<br>
<a href="https://www.youtube.com">Youtube <!--Link-->
</a>
</p </div>
<div class="column">
<!--My Story Header-->
<h4>My Story
</h4>
<p>Hey there! I'm aspiring music website creator!
</p>
</div>
</div>
</div>
The display: inline-block; should put the elements side-by-side according to MIMO but this doesn't happen
you can float it to left.
you also have a wrong closing tag here...
</p </div>
.column {
min-width: 300px;
display: inline-block;
vertical-align: top;
float: left;
}
<div id="footer">
<!--Footer-->
<div class="container">
<div class="column">
<h4>My Links
<!--My Links Header-->
</h4>
<p>
Soundcloud <!--Link-->
<br>
Youtube <!--Link-->
</p>
</div>
<div class="column">
<!--My Story Header-->
<h4>My Story
</h4>
<p>Hey there! I'm aspiring music website creator!
</p>
</div>
</div>
</div>
Remove the broken </p in your HTML. And add float: left; to the column class.
you can use this example:
.column {
min-width: 300px; /*DOES NOT WORK*/
display: inline-block; /*DOES NOT WORK*/
vertical-align: top; /*DOES NOT WORK*/
}
<div id="footer">
<!--Footer-->
<div class="container">
<div class="column">
<h4>My Links
<!--My Links Header-->
</h4>
<p>
<a href="https://soundcloud.com/discover">Soundcloud <!--Link-->
</a>
<br>
Youtube
</p>
</div>
<div class="column">
<!--My Story Header-->
<h4>My Story
</h4>
<p>Hey there! I'm aspiring music website creator!
</p>
</div>
</div>
</div>
Consider using flex. In your case, you would need to set the display to flex to to .container:
.container{
display: flex;
}
If you want both children to have the same width you can simply add flex: 1 to their CSS properties.
You can check the following snippet.
.container{
display: flex;
}
.column{
flex: 1;
}
<div id="footer">
<!--Footer-->
<div class="container">
<div class="column">
<h4>My Links
<!--My Links Header-->
</h4>
<p>
<a href="https://soundcloud.com/discover">Soundcloud <!--Link-->
</a>
<br>
Youtube
</p>
</div>
<div class="column">
<!--My Story Header-->
<h4>My Story
</h4>
<p>Hey there! I'm aspiring music website creator!
</p>
</div>
</div>
</div>

trouble implementing card like view in html and css

Expected output image illustration:
html, body
{
max-width: 100vw;
max-height: 100vh;
}
html *
{
font-family: Arial !important;
}
.cand1
{
width: 50%;
float:left;
}
.cand2
{
width:50%;
float: right;
}
.prof1,.prof2
{
margin:0;
margin-top: 40;
text-align: center;
}
.name
{
font-weight: bold;
}
.post
{
font-weight: bolder;
}
.card
{
background: rgb(230, 230, 230);
}
h4
{
background: rgb(230, 230, 230);
}
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles/style_vote.css">
</head>
<body>
<div id="header"></div>
<div id="wrapper">
<div id="content">
<div class="card">
<h4 class="post">Post 1</h4>
<div class="cand1">
<div class="prof1">
<img src="images/dummy1.jpg">
<p class="name">Candidate 1</p>
<p class="add">Class</p>
</div>
</div>
<div class="cand2">
<div class="prof2">
<img src="images/dummy1.jpg">
<p class="name">Candidate 2</p>
<p class="add">Class</p>
</div>
</div>
</div>
<div class="card">
<h4 class="post">Post 2</h4>
<div class="cand1">
<div class="prof1">
<img src="images/dummy1.jpg">
<p class="name">Candidate 3</p>
<p class="add">Class</p>
</div>
</div>
<div class="cand2">
<div class="prof2">
<img src="images/dummy1.jpg">
<p class="name">Candidate 4</p>
<p class="add">Class</p>
</div>
</div>
</div>
<div class="card">
<h4 class="post">Post 3</h4>
<div class="cand1">
<div class="prof1">
<img src="images/dummy1.jpg">
<p class="name">Candidate 5</p>
<p class="add">Class</p>
</div>
</div>
<div class="cand2">
<div class="prof2">
<img src="images/dummy1.jpg">
<p class="name">Candidate 6</p>
<p class="add">Class</p>
</div>
</div>
</div>
<div class="card">
<h4 class="post">Post 4</h4>
<div class="cand1">
<div class="prof1">
<img src="images/dummy1.jpg">
<p class="name">Candidate 7</p>
<p class="add">Class</p>
</div>
</div>
<div class="cand2">
<div class="prof2">
<img src="images/dummy1.jpg">
<p class="name">Candidate 8</p>
<p class="add">Class</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Current output image:
I am trying to implement a card like style with html and css.
the h4 tag in the div card produces spaces ,on using margin 0 and padding 0 in css it produces a white line ,I also couldn't find to split each card,tried margin as well as padding attributes for the card div,doesn't seem to work.
also the attributes i apply on the entire card div doesn't seem to apply on the h4 tag, modifying other attributes such as height on the card div makes the dummy image pop out of the card div section
Since your code is pretty messy i created a simple example for you. Hope it helps.
Also try to avoid !important to keep your code clean and maintainable.
section {
background: gray;
padding: 10px 25px;
margin: 0 0 25px 0;
}
section h4 {
margin: 0 0 10px 0;
}
.card-wrapper {
display: flex;
justify-content: space-around;
}
.card--text {
text-align: center;
}
<div class="container">
<section>
<h4>Post</h4>
<div class="card-wrapper">
<div class="card">
<img src="https://dummyimage.com/150x150/000/fff" />
<p class="card--text">
I am the Text
</p>
</div>
<div class="card">
<img src="https://dummyimage.com/150x150/000/fff" />
<p class="card--text">
I am the Text
</p>
</div>
</div>
</section>
<section>
<h4>Post</h4>
<div class="card-wrapper">
<div class="card">
<img src="https://dummyimage.com/150x150/000/fff" />
<p class="card--text">
I am the Text
</p>
</div>
<div class="card">
<img src="https://dummyimage.com/150x150/000/fff" />
<p class="card--text">
I am the Text
</p>
</div>
</div>
</section>
</div>

Mobile Responsive section

I have a bit of an issue with a site I am creating. I need an alternative of float: left; for these icons. below I will upload two screenshots of the mobile screen and the computer screen.
Computer Size
Mobile Size
This is my code:
.featureIcon {
width: 70px;
float: left;
}
.featureRowSplit {
padding-bottom: 30px;
padding-top: 20px;
}
.featureText {
font-family: 'Lato', sans-serif;
color: #146eff;
margin-left: 80px;
}
<div class="row">
<div class="col-md-8">
<div class="row featureRowSplit">
<div class="col-md-4">
<img src="img/FeatureIcons/1.png" class="featureIcon">
<h3 class="featureText">Cheap</h3>
</div>
<div class="col-md-4">
<img src="img/FeatureIcons/2.png" class="featureIcon">
<h3 class="featureText">Friendly</h3>
</div>
<div class="col-md-4">
<img src="img/FeatureIcons/3.png" class="featureIcon">
<h3 class="featureText">Clean Code</h3>
</div>
</div>
<div class="row">
<div class="col-md-4">
<img src="img/FeatureIcons/4.png" class="featureIcon">
<h3 class="featureText">Quick</h3>
</div>
<div class="col-md-4">
<img src="img/FeatureIcons/5.png" class="featureIcon">
<h3 class="featureText">Helpful</h3>
</div>
<div class="col-md-4">
<img src="img/FeatureIcons/6.png" class="featureIcon">
<h3 class="featureText">Reliable</h3>
</div>
</div>
</div>
<div class="col-md-4">
</div>
</div>
Best Regards,
Ben J
Do want them to align in one column? If so, you can set the whole thing in an unordered list and put the image and header in there. For the css, put list-style-type:none;for the unordered list, and put display:block;and float:left; for the actual li elements.

irritating div with content

Here is my http://jsfiddle.net/8wSzk/2/
<div class="row1">
<div>
<div class="circle-menu">
</div>
<p> some option </p>
</div>
<div>
<div class="circle-menu">
</div>
<p> some option <br /> and <br /> another option </p>
</div>
</div>
<div class="row2">
<div>
<div class="circle-menu">
</div>
<p> circle3 </p>
</div>
<div>
<div class="circle-menu">
</div>
<p> circle4 </p>
</div>
</div>
I want my both circle to be in a straight line with its content just below the circle. can somebody help me fixing my css. I am quite new to it.
I think this is what you want. If you want to have two elements side to side, you must use the float attribute. In this case, it would be float:left;.
EDIT
NEW DEMO
Do it like this
<div class="row1">
<div>
<div class="circle-menu">
</div>
</div>
<div>
<div class="circle-menu">
</div>
</div>
</div>
<div class="row1">
<div>
<p> some option </p>
</div>
<div>
<p> some option <br /> and another option </p>
</div>
</div>
New fiddle Code:Works Perfect
Here you go mate, redone it for you. Have a look through it and see what I've done
<div class="row1">
<div class="circle-menu">
</div>
<div class="circle-menu">
</div>
</div>
<div class="options-row">
<div class="option">Some option
</div>
<div class="option">Some more options
</div>
</div>
<div class="row2">
<div class="circle-menu">
</div>
<div class="circle-menu">
</div>
</div>
<div class="options-row">
<div class="option">Even more options
</div>
<div class="option">Got the idea?
</div>
</div>
.row1 {
height:90px;
}
.row2 {
height:90px;
}
.circle-menu {
width: 80px;
height: 80px;
display: inline-block;
float:left;
background-color: #cacece;
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
cursor: pointer;
margin: 5px;
}
.option {
display:inline-block;
width:80px;
margin: 5px;
text-align:center;
vertical-align:top;
}
.options-row {
}