I want to increase the image size whenever the window size decreases and I used the media queries for that. whenever the window size is 423 then the image size increases. so I tried using media queries but it didn't apply to that tag. how to increase the size? this is my HTML and CSS
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
#media screen and (max-width:768px ) and (min-width: 320px)
{
.samyata {
width:100px;
height:auto;
}
}
</style>
</head>
<body>
<div class="container-fluid text-center" style="background-color:#F2F2F2"><br>
<h3 style="text-align:left;margin-left:12%;font-family: 'Raleway';"> Explore Samyata</h3> <br><br>
<div class="row" id = "first" style="margin-left:7%" >
<div class="col-sm-6">
<img src="Assets/img/sam.png" class = "samyata"
hspace="30" style="width:28%;height:40%;float:left;">
<h5 style="font-family: 'Fira Sans Condensed';text-align: left;">
Get it the way you want </h5>
<p class="text" style="text-align:left;font-size:13px;font-family: 'Dosis';">
A new and effecient retail commerce platform
and ecosystem to bring stores, shoppers and
personal shoppers together in a geographically
specific, simple buying and selling experience.
</p>
<a href = "#" class = "text3"
style="color: #2F80ED;text-align:left;font-family: 'Ubuntu';margin-right:63%;"> Explore Samayata </a>
</div>
<div class="col-sm-6">
<img src="Assets/img/vahaka.png" hspace = "30" class = "vahaka" style="width:28%;height:40%;float:left;">
<h5 style="font-family: 'Fira Sans Condensed';text-align: left">
Make money as a personal shopper </h5>
<p class="text" style="text-align:left;font-size: 13px;font-family: 'Dosis'">
Deliver shopper purchases.
Be your own boss. Do it when you want.
Get paid right away.
</p>
<a href = "#" class ="text3"
style="color: #2F80ED;text-align:left;font-family: 'Ubuntu';margin-right:70%"> Explore Vahaka </a>
</div>
</div><br><br>
<div class = "row" style="margin-left:7%">
<div class="col-sm-6" >
<img src="Assets/img/gananam.png" hspace = "30" style="width:28%;height:40%;float:left;">
<h5 style="font-family: 'Fira Sans Condensed';text-align: left;">
Attract shoppers to your stores </h5>
<p class="text" style="text-align:left;font-size:13px;font-family: 'Dosis'">
Partner with Samyata Stores
for a new way to make money,
reach new customers and deliver
products to your customers.</p>
<a href = "#" class = "text3"
style="color: #2F80ED;text-align:left;font-family: 'Ubuntu';
margin-right: 63%"> Explore Gananam </a><br><br><br>
</div>
</div><br>
</div>
</body>
How to apply that? please help me out from this problem. I want all the images and text side by side when the window size is decreases and increase but when i decreases i comes same part of the text under the image. i want all the text on the same side of image.
The img with class="samyata" has its style inline (i.e. in a style attribute). This will always override the style in the stylesheet.
Solution: take the style out of the attribute and put it in the stylesheet, above the media query.
Your other problem, the text wrapping around below the images, can be solved by putting the text in a block of its own and giving that a left margin.
.samyata, .vahaka, .gananam {
width: 28%;
height: 40%;
float:left;
}
.row {
padding-bottom: 1em;
}
.block {
margin-left:37%;
}
.col-sm-6 h5 {
margin-top: 0;
font-family: 'Fira Sans Condensed';
text-align: left;
}
#media screen and (max-width: 768px) and (min-width: 320px) {
.samyata, .vahaka, .gananam {
width: 100px;
height: auto;
}
.block {
margin-left:130px;
}
}
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="container-fluid text-center" style="background-color:#F2F2F2"><br>
<h3 style="text-align:left;margin-left:12%;font-family: 'Raleway';"> Explore Samyata</h3> <br><br>
<div class="row" id="first" style="margin-left:7%">
<div class="col-sm-6">
<img src="https://i.stack.imgur.com/rblbG.jpg" class="samyata">
<div class="block">
<h5> Get it the way you want </h5>
<p class="text" style="text-align:left;font-size:13px;font-family: 'Dosis';">
A new and effecient retail commerce platform and ecosystem to bring stores, shoppers and personal shoppers together in a geographically specific, simple buying and selling experience.
</p>
Explore Samayata
</div>
</div>
</div>
<div class="row" style="margin-left:7%">
<div class="col-sm-6">
<img src="https://i.stack.imgur.com/N3atj.jpg" class="vahaka">
<div class="block">
<h5> Make money as a personal shopper </h5>
<p class="text" style="text-align:left;font-size: 13px;font-family: 'Dosis'">
Deliver shopper purchases. Be your own boss. Do it when you want. Get paid right away.
</p>
Explore Vahaka
</div>
</div>
</div>
<div class="row" style="margin-left:7%">
<div class="col-sm-6">
<img src="https://i.stack.imgur.com/TUvgC.jpg" class="gananam">
<div class="block">
<h5> Attract shoppers to your stores </h5>
<p class="text" style="text-align:left;font-size:13px;font-family: 'Dosis'">
Partner with Samyata Stores for a new way to make money, reach new customers and deliver products to your customers.</p>
<a href="#" class="text3" style="color: #2F80ED;text-align:left;font-family: 'Ubuntu';
margin-right: 63%"> Explore Gananam </a>
</div>
</div>
</div>
</div>
Also, don't use hspace. It is deprecated and has compatibility problems. Use margins instead.
Edit: I made some changes, but I'm not sure it looks the way you want now. So consider this a work in progress.
Related
My question is a pretty straightforward one. I'm using Bootstrap 4.0 to make a website. I have a Carousel Element below which my Container begins. The Container consists of two Rows, one for the Footer and the other for the Columns that house my content. I'm trying to align the three columns side-by-side (like actual columns). Each Column consists of one DIV Element (Bootstrap Column Class); with one image and text below it image. This works fine when I set the size properties of the images in the index.html file. However, once I copy the same information into my custom CSS file, the columns become stacked. I'm pretty sure I'm calling the images with the correct Syntax in CSS. But its just not working. I'm attaching screenshots to give an idea of what I intent to do and what actually is happening.
Any sort of help would be highly appreciated.
Thank You.
HTML CODE:
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel = "stylesheet" href="custom.css">
<title>AlphaGamigLeague</title>
</head>
<body>
<nav class="navbar nav-pills">
<a class="navbar-brand" href="#">
<img src="https://drive.google.com/uc?export=download&id=1G0450PwU5dcfQ9g4lRuZjl6C8MP8ZNbh" width="100px" height="100px">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
<!-- End Of Navigation Bar -->
<!-- Beginning Of Carousel -->
<div id="mycarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="https://drive.google.com/uc?export=download&id=1G0450PwU5dcfQ9g4lRuZjl6C8MP8ZNbh" height="650px" width="400px" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://drive.google.com/uc?export=download&id=1Rq95g-w1Dpr-pq9vuI4p9bVV2hHPHiIw" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://drive.google.com/uc?export=download&id=1G0450PwU5dcfQ9g4lRuZjl6C8MP8ZNbh" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#mycarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#mycarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!-- End Of Carousel -->
<!-- Beginning Of Container -->
<br>
<br>
<!-- Beginning Of Main Content -->
<!-- Bootstrap Container Begins Here -->
<div class="container">
<!-- First Row Begins Here -->
<div id = "myRow1" class="row">
<!-- First Column Begins Here -->
<div id = "whoarewe" class="col-md">
<br>
<h3>
Who Are We?
</h3>
<br>
<img id = "myfirstImage" src= "https://drive.google.com/uc?export=download&id=1TXd3BvbLa9kFb4N9bq4P8KY_cDx1flSF"class= "hover" width = "350px" height= "400px">
<p class= "fsfwt48t948489tugjwj4h9u4 ubuw ughwu9 g">
</p>
<br>
<p>
Alpha Gaming League, also known as AGL eSports, is a professional eSports organization. We aim to not only provide a platform for Pakistani gaming and eSports enthusiants to showcase their talent but also benefit in numerous ways; especially financially. Our goal is to be the very best in the business. We don't just want to be known as one of the key pioneers of the eSports industry in the country but want ot be known as the pioneers of the eSports industry that continue to raise the bar and set new standards in terms of eSports in Pakistan. The be the ultimate leader and lead by example is what AGL eSports thrives to be.
</p>
</div>
<!-- First Column Begins Here -->
<!-- Second Column Begins Here -->
<div id = "myRow1Column2" class="col-md">
<br>
<h3>
Our Tournaments
</h3>
<br>
<img id = "mysecondImage" src= "https://drive.google.com/uc?export=download&id=1apY_1ssrqv9u1SRCiQoZOJG4DoFho87H" width = "350px" height= "400px">
<br>
<p>
Alpha Gaming League(AGL eSports) holds a variety of tournaments every year. We are able to successfully do this based on years of knowledge and experience in the field. Some of the titles for which competitions and tournaments are held include:
<br>
<br>
Battlefield (Console + PC)
<br>
Blur (Console)
<br>
Call Of Duty (Console + PC)
<br>
Counter Strike(PC)
<br>
DoTA2 (PC)
<br>
FIFA (Console)
<br>
Fortnite (Consile + PC)
<br>
Player Unknown's Battle Grounds (Console + PC)
<br>
Tekken (Console)
<br>
etc...
<br>
<br>
These titles are just a few of the many we have to offer.
Not only this, but players at our competitions are guaranteed to win exciting prozes, which includes prize money, goodi bags and much more.
</p>
</div>
<!-- Second Column Ends Here -->
<!-- Third Column Begins Here -->
<div id = "myRow1Column3" class="col-md">
<br>
<h3>
Partnerships
</h3>
<br>
<img id ="mythirdImage" src= "https://drive.google.com/uc?export=download&id=1X0J3m9a8V5gOVu5WX1VwBQMMPWar4H7q" width = "350px" height= "400px">
<br>
<p>
At alpha Gaming League, we believe in the power of unity and working together as a team. It is only by working together that positive results can be achieved. We are always on the lookout for individuals or groups of individuals that have something exiting and unique to bring to the table. Because let's face it, in today's world, only unique ideas survive. If you or your organization thinks it has what it takes to fulfill our expectations and is interested in working alongside us, don't hesitate to get in touch with us. You can "Click Here" to send us a query and get in-touch with us.
</p>
</div>
<!-- Third Column Ends Here -->
</div>
<!-- First Row Ends Here -->
<!-- Footer Begins Here -->
<!-- Second Row Begins Here -->
<div id = "myRow2" class="row">
<!-- First Column Begins Here -->
<div id = "myRow2Column1" class="col-md">
sdasdasdasdasdasda
<br>
<!-- Disclaimer DIV Begins Here -->
<div id = "disclaimer">
<p>
All rights reserved. No fhsofsei fhioyw39847 ryo8wrt 48wotr o3qwryy 9aw4ro87
</p>
</div>
<!-- Disclaimer DIV Ends Here -->
</div>
<!-- First Column Ends Here -->
<!-- Second Columns Begins Here -->
<div id = "myRow2Column2" class="col-md">
<br>
<!-- Instagram Icon DIV Begins Here -->
<div id = "instagram">
<img src= "https://drive.google.com/uc?export=download&id=1jiCKayOmqF5hk1FDrF9wAfiG2VYlHoki" width= "50px" height = "50px" align = "right">
</div>
<!-- Instagram Icon DIV Ends Here -->
<!-- Twitter Icon DIV Beginss Here -->
<div id = "twitter">
<img src= "https://drive.google.com/uc?export=download&id=1JhT0U6SXfrZ8jyKOUhbZoEs7kpQ7bdXp" height= "50px" width= "50px" align = "right">
</div>
<!-- Twitter Icon DIV Ends Here -->
<!-- Facebook Icon DIV Begins Here -->
<div id = "facebook">
<img src= "https://drive.google.com/uc?export=download&id=1ZGjOfBJHrzCrXeP3hoc2FsgCLFX41sq2" height= "50px" width= "50px" align = "right">
</div>
<!-- Facebook Icon DIV Ends Here -->
</div>
<!-- Second Column Ends Here -->
</div>
<!-- Second Row Ends Here -->
</div>
<!-- Bootstrap Container Ends Here -->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
CSS CODE:
.logo_image {
height: 200px;
width: 100px;
}
/* .nav-brand allows the logo properties to be changed */
.navbar-brand {
}
.navbar{
background-color: black;
}
.navbar-toggler{
background-color: orange;
border-radius: 8px;
}
.navbar navbar-expand-lg{
background-color: aqua;
}
.collapse{
background-color: aqua;
}
.btn{
background-color: whitesmoke;
}
.body{
background-color: black:
}
.carousel-inner{
height: 650px;
}
.carousel-item active{
height: 90px;
}
.item active{
height: 50px;
}
#myRow1{
background-color: pink;
height:auto;
width: auto;
}
#whoarewe{
text-align: center;
height: auto;
font-family: monospace;
font-weight: 900;
font-size: 15px;
}
#myRow1Column2{
text-align: center;
height: auto;
font-family: monospace;
font-weight: 900;
font-size: 15px;
}
#myRow2{
background-color: forestgreen;
height:auto;
}
#myRow1Column3{
text-align: center;
height: auto;
font-family: monospace;
font-weight: 900;
font-size: 15px;
}
#disclaimer{
width: 300px;
text-align: left;
}
#socialMediaLinks{
position: relative;
bottom: 30px;
}
#myRow2Column2{
margin-right: 40px;
margin-left: 100px;
}
#instagram{
position: relative;
right: 20px;
}
#twitter{
position: relative;
right: 40px;
}
#facebook{
position: relative;
right: 60px;
}
#myfirstImage{
width = 150px;
height= 400px;
}
#mysecondImage{
width = 350px;
height= 400px;
}
#mythirdImage{
width = 350px;
height= 400px;
}
#firstImage{
}
#secondImage{
}
#thirdImage{
}
#secondImage:hover{
opacity: 0.6;
visibility: visible;
}
Intended Layout. Works when image size dimensions are specified in index.html.
Actual layout. When image size dimensions are removed from index.html and added to the CSS file.
Remove fix width from the images and add the img-fluid class to them.
I mean, what exactly do you expect to happen when you set fix width on the images? Anyway, the first step is to remove the fix width and then, to make the images responsive, you add the img-fluid class.
Here's the working code snippet:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<!-- Bootstrap Container Begins Here -->
<div class="container">
<!-- First Row Begins Here -->
<div id = "myRow1" class="row">
<!-- First Column Begins Here -->
<div id = "whoarewe" class="col-md">
<br>
<h3>
Who Are We?
</h3>
<br>
<img class="img-fluid" id = "myfirstImage" src= "https://drive.google.com/uc?export=download&id=1TXd3BvbLa9kFb4N9bq4P8KY_cDx1flSF"class= "hover">
<p class= "fsfwt48t948489tugjwj4h9u4 ubuw ughwu9 g">
</p>
<br>
<p>
Alpha Gaming League, also known as AGL eSports, is a professional eSports organization. We aim to not only provide a platform for Pakistani gaming and eSports enthusiants to showcase their talent but also benefit in numerous ways; especially financially. Our goal is to be the very best in the business. We don't just want to be known as one of the key pioneers of the eSports industry in the country but want ot be known as the pioneers of the eSports industry that continue to raise the bar and set new standards in terms of eSports in Pakistan. The be the ultimate leader and lead by example is what AGL eSports thrives to be.
</p>
</div>
<!-- First Column Begins Here -->
<!-- Second Column Begins Here -->
<div id = "myRow1Column2" class="col-md">
<br>
<h3>
Our Tournaments
</h3>
<br>
<img class="img-fluid" id = "mysecondImage" src= "https://drive.google.com/uc?export=download&id=1apY_1ssrqv9u1SRCiQoZOJG4DoFho87H">
<br>
<p>
Alpha Gaming League(AGL eSports) holds a variety of tournaments every year. We are able to successfully do this based on years of knowledge and experience in the field. Some of the titles for which competitions and tournaments are held include:
<br>
<br>
Battlefield (Console + PC)
<br>
Blur (Console)
<br>
Call Of Duty (Console + PC)
<br>
Counter Strike(PC)
<br>
DoTA2 (PC)
<br>
FIFA (Console)
<br>
Fortnite (Consile + PC)
<br>
Player Unknown's Battle Grounds (Console + PC)
<br>
Tekken (Console)
<br>
etc...
<br>
<br>
These titles are just a few of the many we have to offer.
Not only this, but players at our competitions are guaranteed to win exciting prozes, which includes prize money, goodi bags and much more.
</p>
</div>
<!-- Second Column Ends Here -->
<!-- Third Column Begins Here -->
<div id = "myRow1Column3" class="col-md">
<br>
<h3>
Partnerships
</h3>
<br>
<img class="img-fluid" id ="mythirdImage" src= "https://drive.google.com/uc?export=download&id=1X0J3m9a8V5gOVu5WX1VwBQMMPWar4H7q">
<br>
<p>
At alpha Gaming League, we believe in the power of unity and working together as a team. It is only by working together that positive results can be achieved. We are always on the lookout for individuals or groups of individuals that have something exiting and unique to bring to the table. Because let's face it, in today's world, only unique ideas survive. If you or your organization thinks it has what it takes to fulfill our expectations and is interested in working alongside us, don't hesitate to get in touch with us. You can "Click Here" to send us a query and get in-touch with us.
</p>
</div>
<!-- Third Column Ends Here -->
</div>
<!-- First Row Ends Here -->
</div>
I'd like to put a Font Awesome font to the upper image section of bootstrap card component, card-img-top.
Following similar with the official guide and some solution, it didn't work:
// card-img.css
<script>
FontAwesomeConfig = { searchPseudoElements: true };
</script>
.card-top-img {
display: none;
}
.card-head::after {
font-family: "Font Awesome 5 Solid";
content: "\f15c";
}
<!-- list.html (I'm do in Django project) -->
<div class="row">
{% for resume in resume_list %}
<div class="col-md-4">
<div class="card mb-4 box-shadow">
<!-- add for pseudo element -->
<div class="card-head">
<img class="card-img-top" src="" alt="">
</div>
<div class="card-body text-center">
<h5 class="card-title text-success">
</div>
...
But it just render small empty box:
How can I work this?
You need to include the following link in your head section:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
Or, if you are using Font Awesome version 5, you need to include this in the head section of your HTML document:
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
You not put font awesome class file
<i class="fas fa-file-alt"></i>
try this
<div class="card-head">
<i class="fas fa-file-alt"></i>
</div>
and you need to put in your header
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
try to read guidance https://fontawesome.com/get-started/web-fonts-with-css
Being new to bootstrap and scripting with html/css in general, I am attempting to create a simple html table (one row with three columns). Each column is to be even (taking up one third of the table which it exists inside of. The problem I am encountering is that it appears to be taking up only two-thirds (2/3) of the available space with in the table. I've looked on the internet for solutions, googled, read a several posts/articles on stack and other places, but I've not found a solution and am hoping for help.
You can see a straight html render of the error here
Here is a picture detailing the issue:
As the example image shows the thin red column is taking up one third of the table space (green bordered table), however that table is not expanding to occupy the full space available to it in the red div. I've looked for through the html render and not found a cause for the issue.
<div class="area">
<section class="wrapper scrollable">
<div class="main-grid">
<div class="agile-grids">
<!-- blank-page -->
<div class="blank">
<div class="blank-page">
<h1>Session is active</h1>
<table class=" " style="border: 1px solid red;">
<tbody>
<tr scope="row" style="border: 1px solid red;">
<td class="text-center" style="border: 1px solid green;">
<div class="col-lg-4 col-md-6 col-sm-12" style="border: 1px solid red;">
<div class="card_user-charProfile">
<img class=" img-fluid" style="width: 100%;" src="http://localhost/wBase/zUploads/cImg/3bgCard.jpg" alt="Wiccan">
<div class="card">
<div class="card">
<p> content goes here</p></div>
</div>
</div> <!-- end row -->
</div><!-- end CHARACTER PROFILE OUTER DIV -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
Here are the CSS declarations / links
<script language="JavaScript" type="text/javascript">
<!-- This JS disallows hijacking into someone else's frame...
if (top.location != self.location){top.location=self.location}
//-->
</script>
<link href="../__themes/bs4_marvelCSS/bs4_bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="../__themes/bs4_marvelCSS/bs4_dashV3.css" rel="stylesheet">
<link href="../__themes/bs4_marvelCSS/style_sticky-footer-navbar.css" rel="stylesheet">
<link href="../__themes/bs4_marvelCSS/bs4_dashTweaks.css" rel="stylesheet">
<!-- font CSS -->
<!-- roboto -->
<link href="//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic" rel="stylesheet" type="text/css">
<!-- lato -->
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<!-- hammersmith one -->
<link href="https://fonts.googleapis.com/css?family=Hammersmith+One" rel="stylesheet">
<!-- __themes/_fonts/font-glyphicons.css -->
<link href="../__themes/bs4_marvelCSS/font.css" rel="stylesheet">
<link href="../__themes/bs4_marvelCSS/font-awesome.css" rel="stylesheet">
<link href="../__themes/bs4_marvelCSS/font-glyphicons.css" rel="stylesheet">
<script type="application/x-javascript">addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<script>
$(function () {
$("#supported").text("Supported/allowed: " + !!screenfull.enabled);
if (!screenfull.enabled) {
return false;
}
$("#toggle").click(function () {
screenfull.toggle($("#container")[0]);
});
});
</script>
Why are you using the table? You can handle that all with the bootstrap grid system. Avoid using table in your project. But I will suggest you to give it a width:
td{width:100% !important;}
Try doing this it may help you.
I am new to bootstrap coding and CSS I am stuck in one issue where in the desktop version i need one image but when it comes to the mobile version i need the second image to be shown and first image should hide.
<div class="col-md-9" style="padding: 0px;">
<img src="images/Trinity-Garden-landing-Page-1.jpg" width="1350px" />
<img src="images/Trinity-Garden-landing-Page-4.jpg" width="1350px" />
</div>
Help needed.
Please implement this code.
You can change max width in media query according to your need. Also please expand snippet to check hide and show image according to device.
I hope it will work for you.
<style>
.image_section img{
display: block;
}
#media (max-width:640px){
.image_section img:first-child{
display:none;
}
}
</style>
<div class="col-md-9 image_section" style="padding: 0px;">
<img src="images/Trinity-Garden-landing-Page-1.jpg" />
<img src="images/Trinity-Garden-landing-Page-4.jpg" />
</div>
Use the below code, It might help you..
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="Masters_baby.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style type="text/css">
#media(max-width:767px){
.image1 {
display: block!important;
}
.image2 {
display: none !important;
}
}
</style>
</head>
<body>
<div class="row">
<img src="img/kiran.png" alt="img1" style="height: 200px;width: 200px;display:none;" class="image1">
<img src="img/kiran2.png" alt="img1" style="height: 200px;width: 200px;display: block;" class="image2">
</div>
</body>
</html>
In that I used #media query to hide first image and display second image on mobile view.
You can use bootstrap responsive utilities for showing/hiding components based on the screen size.
Your code snippet has been modified as an example.
The first image will be visible in medium sized screens only
The second image will be hidden on medium sized screens
<div class="col-md-9" style="padding:0px;">
<img class="visible-md-block" src="images/Trinity-Garden-landing-Page-1.jpg" width="1350px" />
<img class="hidden-md" src="images/Trinity-Garden-landing-Page-4.jpg" width="1350px" />
</div>
UPDATED :
Try these classes :
http://getbootstrap.com/css/#responsive-utilities-classes
for the image that must only show in the desktop use :
hidden-xs hidden-sm hidden-md
for image that must show only on mobile use :
hidden-lg hidden-xl
example :
<div class="col-md-9" style="padding:0px;">
<img class=" hidden-lg hidden-xl " src="images/Trinity-Garden-landing-Page-1.jpg" width="1350px" />
<img class="hidden-xs hidden-sm hidden-md" src="images/Trinity-Garden-landing-Page-4.jpg" width="1350px" />
</div>
You may want to have a look at the picture element. Support is quite good now.
Example:
<picture>
<source srcset="mdn-logo-wide.png" media="(min-width: 600px)">
<img src="mdn-logo-narrow.png" alt="MDN">
</picture>
Can someone take a look at my html? Previously, my scrollspy was working but I dont know what happend and its not working anymore. I have been at this for 2 hours and I still can't get it to work. I dont recall doing any breaking changes.
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nate The Great</title>
<link href="https://fonts.googleapis.com/css?family=Bungee|Istok+Web|Lora" rel="stylesheet">
<link rel="stylesheet" href="./assets/css/bootstrap.min.css">
<link rel="stylesheet" href="./assets/css/main.css">
<link rel='shortcut icon' type='image/x-icon' href='./assets/img/favicon.ico' />
</head>
<body data-spy="scroll" data-target="#navbar" >
<!--Start of Navigation Bar-->
<div class="navbar transparent pull-right navbar-fixed-top" id="navigation">
<div class="container-fluid">
<p class="navbar-brand " id="brand"> <img src="./assets/img/profile.jpg" alt="" style="display: inline; margin-right: 3px; border-radius:50%">Nathaniel D Alcedo Jr</p>
<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse navHeaderCollapse">
<ul class="nav navbar-nav navbar-right">
<li class="active">Home</li>
<li>Projects</li>
<li>About</li>
<!--<li>Blog</li> will workk on this-->
</ul>
</div>
</div>
</div>
<!--End of Navigation Bar-->
<!--Landing Page-->
<div id='home'>
<h1>
Nathaniel D Alcedo Jr,
</h1>
<h2 >aspiring web developer</h2>
</div>
<!--End of Landing Page-->
<div class="text-center" id="portfolio">
<h1>Projects Finished</h1>
<p>Free Code Camp <u>Calculator</u></p>
</div>
<div class="pull-left" id="about">
<h1>A little about me</h1>
<p>
Hello there! As the title suggests, I am an aspiring web developer.
I'm currently serving my time in the Singapore Armed Forces and in my free time, I like to muck
around on the computer. It ranges from making mock websites to thinking of my own implementations
of basic data structures. I find pleasure in breaking code and trying to fix them using stackoverflow.<br><br>
My first contact with a programming languges was in polytechnic during a module on c++. How I sucked terriby!
It wasn't until halfway through my time in national service did I take an interest in programming once again. I'm currently
doing Free Code Camp's course on web development in my free time. I turn operationally ready in may of 2017 and I intend to
look for a job in this wonderful field we call software development.
</p>
</div>
<!--Start ofFooter Bar-->
<!--
<footer class="footer pull-left navbar-fixed-bottom"> TODO: PLACE THIS AT THE BOTTOM OF THE TOTAL PAGE
<div class="container">
<div class="row">
<div class="col-sm-2">
<p>Copyright © Nathaniel</p>
</div>
</div>
</div>
</footer>-->
<!--End of Footer Bar-->
<script src="./assets/js/jquery-3.1.1.min.js"></script>
<script src="./assets/js/bootstrap.min.js"></script>
<script src="https://use.fontawesome.com/c1a4d3ec73.js"></script>
<script>
// This script enalbes the smooth scrolling of pages when clicking links on the Navbar
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top}, 1000);
return false;
}
}
});
});
</script>
</body>
</html>
You need to apply the .navbar-default class to the navbar as well as change your id of id="navigation" to reflect the data-target, currently it's data-target="#navbar".
**Currently there isn't enough content to actually scroll so a generic height is set for example purposes.
Working Example: Open to FullPage
$(function() {
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
.navbar.navbar-default {
background-color: transparent;
border: 0;
}
.navbar.navbar-default .navbar-brand span,
.navbar.navbar-default .navbar-brand img {
display: inline-block;
}
section {
padding-top: 70px;
min-height: 750px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<body data-spy="scroll" data-target="#navbar">
<div class="navbar navbar-default navbar-fixed-top" id="navbar">
<div class="container-fluid">
<div class="navbar-header">
<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand">
<img src="http://placehold.it/20x20/000" alt=""> <span>Nathaniel D Alcedo Jr</span>
</a>
</div>
<div class="collapse navbar-collapse navHeaderCollapse">
<ul class="nav navbar-nav navbar-right">
<li class="active">Home
</li>
<li>Projects
</li>
<li>About
</li>
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<section id='home'>
<h1>Nathaniel D Alcedo Jr,</h1>
<h2>aspiring web developer</h2>
</section>
<section class="text-center" id="portfolio">
<h1>Projects Finished</h1>
<p>Free Code Camp <u>Calculator</u>
</p>
</section>
<section id="about">
<h1>A little about me</h1>
<p>
Hello there! As the title suggests, I am an aspiring web developer. I'm currently serving my time in the Singapore Armed Forces and in my free time, I like to muck around on the computer. It ranges from making mock websites to thinking of my own implementations
of basic data structures. I find pleasure in breaking code and trying to fix them using stackoverflow.
<br>
<br>My first contact with a programming languges was in polytechnic during a module on c++. How I sucked terriby! It wasn't until halfway through my time in national service did I take an interest in programming once again. I'm currently doing Free
Code Camp's course on web development in my free time. I turn operationally ready in may of 2017 and I intend to look for a job in this wonderful field we call software development.
</p>
</section>
</div>
<footer class="navbar navbar-default navbar-fixed-bottom">
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
TODO: PLACE THIS AT THE BOTTOM OF THE TOTAL PAGE
</div>
<div class="col-sm-3">
<p>Copyright © Nathaniel</p>
</div>
<div class="col-sm-3">
<p>Trademark ® Nathaniel</p>
</div>
<div class="col-sm-3">
<p>Something Nathaniel</p>
</div>
<div class="col-sm-3">
<p>Something Nathaniel</p>
</div>
</div>
</div>
</footer>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>