I am new to web development and i am using pre-built template and the below code is showing like the blow image and I am trying to replace it but not able to do. how to replace the background image
<section id="cta" class="section">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-12 align-self-center">
<h2>BLOGGER</h2>
</div>
</div>
</div>
</section>
This might help you :)
<html>
<head>
<style>
#cta{
background-image:url("Here input your image path..");
}
</style>
</head>
<body>
<section id="cta" class="section">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-12 align-self-center">
<h2>BLOGGER</h2> <!-- you can just remove it..Since this is not background image but a heading-->
</div>
</div>
</div>
</section>
</body>
</html>
the background is set in css. need to know your css. you can try to overwrite the background .
.row {
background-image: url(image.jpg);
background-color: #c7b39b;
}
Related
I searched extensively for a solution, including reading similar questions here on stackoverflow, but cannot find an answer. We are using Bootstrap 4.5.1 and have a jumbotron div with a 1920x800 background image that needs to show the entire height and width of the image for all viewpoints. I found solutions that come close, but they either the sides of the jumbotron image gets cut off, the bottom of the image gets cut off, or a lot of space is added beneath the jumbotron image when viewing on smaller devices.
Here's what we have so far:
CSS
.jumbotron {
border-radius: 0;
margin-bottom: 0;
background: url(../img/jumbotronbackground.jpg) no-repeat;
background-size: cover;
}
HTML
<body>
<div class="jumbotron bg-cover">
<div class="container-fluid p-0">
<div class="container bodyCopy">
<div class="overlay"></div>
<div class="row">
<div class="col-sm-12" style="max-width:760px;">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="card-body-right">
<h1 class="card-title">Headline goes here</h1>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-12">
<p>More content goes down here, but it needs to be flush against the bottom of the jumbotron.</p>
</div>
</div>
</div>
I have a classic bootstrap template, like this:
<div class="container">
<div class="row">
<div class="col-12">
...header...
<div class="carouselContainer">
...carousel...
</div>
...content...
</div>
</div>
</div>
and now my website looks like this (H - header, S - slider, C - content, F - footer, with margin: auto):
I want to (visually, using CSS) pull out slider from div.row and div.col-12, like this.
I have tried using position:absolute, but after that, part of content is hidden under slider, plus I want to keep everything safe on different screen resolutions (not using pixels, and maybe on smallest screens carousel will be hidden).
does anyone have an idea how to do it? (I'm sorry if I complicated.)
Try simply stacking different .containers, like this...
<div class="container">
<div class="row">
<div class="col-12">
...header...
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="carouselContainer">
...carousel...
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
...content...
</div>
</div>
</div>
You shouldn't nest .container's but you can stack them! In this case container-fluid will go full width. the others won't.
Why not change the HTML structure and use a container-fluid to wrap your slider.
It would be better ( imho ) to use HTML tags for elements like <header> <main> <footer>
So a structure would be
<header>
<div class="container">
<nav>
Nav here
</nav>
</div>
</header>
<main>
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="slider">
Slider Here
</div>
</div>
</div>
</div>
<div class="container content">
<div class="row">
<div class="col-12">
Content Here
</div>
</div>
</div>
</main>
<footer>
Footer Here
</footer>
What bootstrap container would I use in order for me to centre the text below?
I'm trying to get the text to be centred and I think this has something to do with me picking the wrong container?
JSFIDDLE
<!-- Intro Section -->
<section id="intro" class="intro-section">
<div class="container">
<div class="row">
<div class="col-lg-12 text-justified">
<p class="main1">Welcome to my digital portfolio</p>
<p>My name is Liam Docherty</p>
<p>I'm a web developer from London.</p>
</div>
</div>
</div>
</section>
There is a separate class in Bootstrap 4:
.text-center {
text-align: center !important;
}
html:
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2>Titel</h2>
</div>
</div>
</div>
I'm using Bootstrap v3.3.4.
I want to implement a footer in my web page. But, it doesn't work.
The code of my page:
<!DOCTYPE html>
<html>
<head>
<title>Web site</title>
<link href='css/main.css' rel='stylesheet'>
<!-- Library -->
<link rel="stylesheet" href="Bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="Bootstrap/bootstrap-theme.min.css">
<script src="Script/jquery.min.js"></script>
<script src="Script/bootstrap.min.js"></script>
</head>
<body>
<div class='container'>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 text-center">
<h2><b> My first web site!</b></h2>
<div style="padding-bottom: 10px;"></div>
</div>
</div>
<div class="row well">
<div class="col-md-6 col-sm-6 col-xs-6">
<p>This is my first web site, I'm trying to learn Bootstrap.</p>
<button type='button'>Take the Tour</button>
<button type='button'>Book Tickets Now</button>
</div>
<div class="col-md-6 col-sm-6 col-xs-6">
<img src="Images/universe.jpg" alt="Blasting Off"/>
</div>
</div>
<div class="row well">
<div class="col-md-4 col-sm-4 col-xs-4">
<h3><b>I am 20 years old!</b></h3>
<p>I was born in 1994.</p>
</div>
<div class="col-md-4 col-sm-4 col-xs-4">
<h3><b>I live in Rome!</b></h3>
<p>Rome is a beautiful city.</p>
</div>
<div class="col-md-4 col-sm-4 col-xs-4">
<h3><b>I am a programmer!</b></h3>
<p>I am a front-end developer, I started to do this work recently.</p>
</div>
</div>
</div>
<div class="footer">
<div class="container">
<p class="text-muted">Place sticky footer content here.</p>
</div>
</div>
</body>
NetBeans says Class footer not found
I have included bootstrap.min.css and bootstrap-theme.min.css
If I open the page with a browser (Chrome, im my case) the footer doesn't work..
Why? Thanks.
I'm assuming you're trying to import a footer from the twitter-bootstrap library. Unfortunately twitter-Bootstrap does not include a default CSS for a footer class. (It might do for the HTML-tag , but there is no class).
Depending on what kind footer you want to display there are some examples over at http://www.getbootstrap.com
For example:
http://getbootstrap.com/examples/sticky-footer/
Hope that helped you.
I don't know exactly what you are asking for but this may help.
If you want the footer to be fixed at bottom, then try adding this to your CSS code.
CSS:
.footer {
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
background-color: #f5f5f5;
}
I hope this will help you?
I am making a site for my high school robotics team and I am completely new to html and css. How come one of the columns (the member 10 one) is not functioning like the others?
It seems one of the columns is off center. I'm not sure exactly how to describe it but I can post an image if necessary.
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Robotics Team</title>
<!-- Link to stylesheet -->
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/index1.css">
<!-- Mobile Scaling -->
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!-------------------- UNIFORM CODE ------------------------->
<!-- Navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/Home">Team 3774</a>
</div>
<div class="navbar-collapse collapse" style="height: 0.866667px;">
<ul class="nav navbar-nav">
<li>Team Bio</li>
<li>Our Robot</li>
<li>Our Coach</li>
<li>Gallery</li>
<li>Outreach</li>
<li>Youtube</li>
</ul>
</div>
</div>
</div>
<!-- Banner -->
<div id="top-jumbotron" class="jumbotron">
<img src="/Images/Banner.png" class="img-responsive" alt="Responsive image">
</div>
<!----------------------------------------------------------->
<div class="jumbotron">
<h1>Team Member Bio</h1>
<p>Here you can find links to every member with some information on each of them.</p>
</div>
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="bubble">
<h2>Member 1 </h2>
<p>Team Captain, Engineer, Coder</p>
Read More
</div>
</div>
<div class="col-md-4">
<div class="bubble">
<h2>Member 2</h2>
<p>Head Engineer, Assistant Captain</p>
Read More
</div>
</div>
<div class="col-md-4">
<div class="bubble">
<h2>Member 3</h2>
<p>Head Coder, Head Web-master</p>
Read More
</div>
</div>
<div class="col-md-4">
<div class="bubble">
<h2>Member 4</h2>
<p>Coder, Head Documenter</p>
Read More
</div>
</div>
<div class="col-md-4">
<div class="bubble">
<h2>Member 5</h2>
<p>Engineer, Head 3D Modelling</p>
Read More
</div>
</div>
<div class="col-md-4">
<div class="bubble">
<h2>Member 6</h2>
<p>Coder, Web-master, Engineer</p>
Read More
</div>
</div>
<div class="col-md-4">
<div class="bubble">
<h2>Member 7</h2>
<p>Financial Advisor, Engineer</p>
Read More
</div>
</div>
<div class="col-md-4">
<div class="bubble">
<h2>Member 8</h2>
<p>Engineer, Documenter</p>
Read More
</div>
</div>
<div class="col-md-4">
<div class="bubble">
<h2>Member 9</h2>
<p>Engineer, Coder</p>
Read More
</div>
<div class="col-md-4">
<div class="bubble" id="special">
<h2>Member 10</h2>
<p>Secretary, Mascot</p>
Read More
</div>
</div>
</div>
</div>
</body>
</html>
#top-jumbotron
{
padding-left:0;
padding-right:0;
padding-bottom:0;
margin-bottom: 0;
}
body
{
background-color: #E8E8E8;
}
.bubble
{
background-color: #ffffff;
padding: 20px;
width: 95%;
height: 175px;
border-radius: 15px;
margin-top: 10px;
margin-bottom: 10px;
}
#special
{
float: left;
}
You're just missing a /div - I notice you have a div inside a div, remember you need to close both. I use Netbeans for html and it will tell you if there is a problem. If you are on a Mac, I am told Komodo is really good, too. A good editing program is a life saver!
Fixed code:
<div class="col-md-4">
<div class="bubble">
<h2>Mina Hanna</h2>
<p>Engineer, Coder</p>
Read More
</div>
</div> <!-- this one! -->
edit there are a few things wrong with the code and michael points one out - as he says, Bootstrap is a grid. So Imagine (I actually draw it usually) a box split into 12 columns. For every row div, you should only have columns that add up to 12 inside it. You can break this and it will often still work because the div will just overflow and move down, but it's not best practice. If fixing the missing div end tag doesn't work, try fixing the row structure so it only adds up to 12 columns across the page
You can have a layout like the one you specify, however it wont necessarily work per Bootstraps intended functionality, and as such its usually a good idea to follow their recommended row structure.
Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases.
Instead of
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4"></div>
<div class="col-md-4"></div>
<div class="col-md-4"></div>
<div class="col-md-4"></div>
<div class="col-md-4"></div>
...
</div>
You should do, e.g:
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
<div class="col-md-2"></div>
</div>
Within a row, the sum of the numbers following the hyphen in each column definition should add up to 12.