Adding a semicircle in center on top of Jumbotron - html

I am trying to achieve this design having a semicircle with logo inside in the center. Kindly refer to the link given below.
Image
I have tried making a semicircle using CSS but it won't be suitable for the design that I want. I have used 2 jumbotrons, one after the other. The semicircle should cover the area on both jumbotron as in the image(link mentioned above).
Any help is appreciated on how can I achieve this design.
HTML:
<div class="jumbotron">
<div class="container navheader">
<div class="social">
<i class="fa fa-facebook " aria-hidden="true"></i>
<i class="fa fa-google-plus " aria-hidden="true"></i>
<i class="fa fa-instagram " aria-hidden="true"></i>
</div>
<div class="contact-us">
<a href="">
<i class="fa fa-phone " aria-hidden="true">
<label class="icon-label">CALL 0417 949 773</label></i></a>
</div>
</div>
</div>
<div class="jumbotron other-color">
<div class="container navheader">
<div class="user-actions">
<button class="btn btn-link" data-toggle="modal" data-
target="#sign-in">
<i class="fa fa-lock" aria-hidden="true">
<label class="icon-label">SIGN IN</label>
</i>
</button>
<button class="btn btn-link" data-toggle="modal" data-
target="#sign-up">
<i class="fa fa-user " aria-hidden="true">
<label class="icon-label">CREATE AN ACCOUNT</label>
</i>
</button>
</div>
<div class="div-semicircle top"></div>
<div class="cart">
<a href=""><i class="fa fa-shopping-cart " aria-
hidden="true">
<label class="icon-label">2 ITEM(S)</label>
</i></a>
</div>
</div>
</div>
CSS:
<style>
/* Remove the navbar's default rounded borders and increase the bottom margin */
.navbar {
margin-bottom: 50px;
border-radius: 0;
}
/* Remove the jumbotron's default bottom margin */
.jumbotron {
margin-bottom: 0;
background-color: #5a9f33;
padding: 2em 1em;
}
.other-color {
margin-bottom; 0;
background-color: #67b63d;
padding: 2em 1em;
}
.navheader{
display: inline-block;
width: 100%;
}
.social, .user-actions{
float:left;
}
.contact-us, .cart{
float:right;
}
.sign-up{
background-color:#67b63d;
margin: 0 50px 50px;
padding:20px;
}
input{
padding:15px;
margin:20px;
width:85%;
}
.btn-sign{
background-color: #67b63d;
font-family: serif;
color: white;
border-radius: 30px;
font-size: 2em;
padding: 10px 50px;
margin: 20px auto;
display: block;
}
.title{
font-family: serif;
font-weight: 600;
color: #67b63d;
font-size: 3em;
margin-top:20px;
}
.div-semicircle {
background: #9e978e;
display: inline-block;
margin: 0 1em 1em 0;
}
.top,
.bottom {
height: 45px;
width: 90px;
}
.top {
border-top-left-radius: 90px ;
border-top-right-radius: 90px;
}
</style>
UPDATE:
Solution: In case anyone wants to know, refer to the sample by #bhv in the first comment for reference and tweak it as per your requirement.

first of all your posted code isn't of any help....still I'll try to give a procedure how you can achieve the linked image
create a div not with class .container
create 2 navs inside above created div
create a jumbotron below the navs inside the same div and contain it
in a div with class container
set margins as you need it between these 3 to bring them together
It is clearly visible that you dont need a semicircle..you need an ellipse use clip-path: ellipse(65px 30px at 125px 40px); someting like this to create it within same div then position it in a way you want to using css and give it highest z-index so that it renders as top-most layer.
prey that it works!! ;-)

you must use position:absolute to cover both jumbotron
add these lines of code to this class: .div-semicircle.
position: absolute;
top: 23%;
left: 40%;

Related

How to fix the gap between footer and end of html body?

I added a footer to my page but for some reason there is a gap between the footer and the ending of the body. I am not sure how to fix this issue. I have made many webpages without this issue.
I have included the HTML and CSS from what I have created. I cannot find any issue with the code I have.
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
scroll-behavior: smooth;
}
body {
font-size: 20px;
font-weight: 300;
margin: 0 0 var(--header-height) 0;
}
section {
margin-top: 3rem;
}
.coloredSection {
background-color: var(--pale-green);
color: white;
}
.container {
margin-left: 1.5rem;
margin-right: 1.5rem;
}
.grid {
display: grid;
gap: 1.5rem;
}
<footer id="contact" class="coloredSection contact">
<div class="row align-items-center projects container">
<div>
<h1>Contact Me</h1>
</div>
<div class="contactLinks" id="contacts">
<a
id="profile-link"
href="https://github.com/"
target="_blank"
class="btn contactDetails"><i class="fab fa-github"></i> GitHub</a>
<a
href="https://twitter.com/"
target="_blank"
class="btn contactDetails"><i class="fab fa-twitter"></i> Twitter</a>
<a
href="https://www.linkedin.com/in/"
target="_blank"
class="btn contactDetails"><i class="fab fa-linkedin"></i> LinkedIn</a>
<a href="mailto:"
class="btn contactDetails"><i class="fas fa-envelope"></i> Email me</a>
</div>
<div class="attribution">
©2022 | Designed and Coded by Kianna Hendricks
</div>
</div>
</footer>
<!-- End Contact -->
</body>
</html>
Image:
It seems you have set a margin-bottom for the body:
var(--header-height)
body {
font-size: 20px;
font-weight: 300;
margin: 0 0 var(--header-height) 0;
}
Change margin to margin:0; and it will work fine.
I figured out the issue. I accidently added the projects class to the contact row div. After removing it, the gap went away.

How to make a space between icon and text in CSS

I am learning HTML and CSS. I am practicing by designing some pages but I got a problem. I tried many ways but couldn't fix it. I want to add a space between the icon and the text so that they lock more beautiful.
Image:
CSS:
.facebook {
background: blue;
padding: 0.8rem;
padding-left: 4.1vw;
padding-right: 4.1vw;
margin-left: 0vw;
border-radius: 10px;
}
.facebook:hover {
opacity: 0.5;
}
.google {
background: red;
padding: 0.8rem;
padding-left: 4.6vw;
padding-right: 4.6vw;
margin-left: 3vw;
border-radius: 10px;
}
.google:hover {
opacity: 0.5;
}
HTML:
<div class="login-with">
<i class="fab fa-facebook">Facebook</i>
<i class="fab fa-google">Google</i>
</div>
Can you please help me to fix it. When I add a space manually the link text go to below the icon.
Full Codes link:
CSS: Full Code
HTML: Full Code
Try one of the below methods as mentioned in Fontawesome examples page
Text outside i tag, and add a space in between
<i class="fab fa-facebook"></i> Facebook
Use , below code is from Fontawesome site
<a class="list-group-item" href="#"><i class="fa fa-home fa-fw" aria-hidden="true"></i> Home</a>
If you dont want to change your markup(html) use the below CSS
.login-with > a i::before {
padding-right: 15px;
}
People usually keep the icon element as an empty node and put the text content after it. Then you add a margin to the icon to get appropriate spacing:
.facebook .fab { margin-right: 1em }
<a href="..." class="facebook">
<i class="fab fa-facebook"></i>
<span>Facebook</span>
</a>
The <span> tags are technically not necessary, but it is common to avoid text-only nodes.
Use space or &nbsp between text and icon. Also plz put ; after &nbsp
Place service name outside i tag.
You can add margin-right: 10px; styling to i element,
or display: flex; justify-content: space-between; to the a tag.
It would be best to set a base class for the social icons
/* set base class */
.social-btn {
padding: 0.8rem 4.1vw;
border-radius: 10px;
color: white;
background: gray;
text-decoration: none;
font-family: sans-serif;
}
/* space the buttons */
.social-btn + .social-btn {
margin-left: 1rem;
}
/* set icon padding */
.social-btn i {
padding-right: 0.5rem;
}
/* Modifiers */
.facebook-btn {
background: blue;
}
.google-btn {
background: red;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" rel="stylesheet"/>
<i class="fab fa-facebook"></i>Facebook
<i class="fab fa-google"></i>Google
In Bootstrap you can use me which represents margin from end in icon
<button type="button" class="btn btn-primary"
style="width:150px;"><i class="bi bi-info-circle me-2"></i>Information</button>
Sample Code:
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons#1.10.3/font/bootstrap-icons.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
</head>
<body>
<center>
<button type="button" class="btn btn-primary" style="width:150px;"><i class="bi bi-info-circle me-2"></i>Information</button>
<br><br>
<button type="button" class="btn btn-secondary" style="width:150px;"><i class="bi bi-gear-fill me-3"></i>Settings</button>
<br><br>
<button type="button" class="btn btn-info" style="width:150px;"><i class="bi bi-person-circle me-3"></i>Profile</button>
</center>
</body>
</html>

Why my class doesn't fill 100% of the screen?

I have the following script in my html file:
<template name="SideNav">
<header>Lammah</header>
<body>
dd
</body>
<div class="nav">
<i class="fa fa-user-circle"></i>
<i class="fa fa-upload"></i>
<i class="fa fa-eye"></i>
<i class="fa fa-search"></i>
</div>
</template>
And below is the .css file:
.nav {
border-radius: 5px 5px 0px 0px;
overflow: hidden;
background-color: #b7b7e5;
position: fixed;
bottom: 0;
width: 100%;
}
.nav a {
float: left;
width: 25%;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
a:hover{
background-color: #A3A3CC;
}
When I run the html file, the nav class doesn't start from the beginning of the screen, there is small white space on the left as it is shown in the picture below:
the result
What is causing the nav class to not start from the beginning of the screen (bottom left)?
When I run the html file, the nav class doesn't start from the beginning of the screen, there is
This is because by default the client/main.css contains the following lines:
body {
padding: 10px;
font-family: sans-serif;
}
You should remove it in order to remove the white space.
Furthermore some additions on your Template:
The head and body should only be in your client/main.html while the body content will be rendered using the templates. This is, because Blaze is focused to develop single page applications.
So your code client/main.html may be like the following:
<header>
<title>Lammah</title>
</header>
<body>
{{> SideNav }}
</body>
<template name="SideNav">
<div class="nav">
<i class="fa fa-user-circle"></i>
<i class="fa fa-upload"></i>
<i class="fa fa-eye"></i>
<i class="fa fa-search"></i>
</div>
</template>
The default margins and padding are still in place. What you will need is to make sure the parent element has margins and padding set to 0. So for example, the very first css element you will want to set based off your above code would be this:
template {
margin: 0;
padding: 0;
}
try this one
margin: 0 !important;

Add png in bootstrap button like glyphicon

I want to replace glyphicon-user in bootstrap button with a responsive png, is there any way to do this?
#SignUp-btn{
width: 100% !important;
height: 45% !important;
font-size: 20px;
background-color: #262262;
border-color: #262262;
}
<div class="col-sm-6">
<a href="SignUp" class="btn btn-sq-lg btn-primary" id="SignUp-btn">
<i class="glyphicon glyphicon-user fa-5x"></i>
<br><b> Sign Up</b>
</a>
</div>
See Attached
you can put the image as a background image on the "i" tag. See sample below.
#SignUp-btn + i {
background-image: url(image.png);
text-indent: -9999999999px;
height: 15px;
width: 15px;
}

How to align 2 buttons next to each over horizontally?

Im wanting it to look like:
[BUTTON]
or
[Button 1] [Button2]
But im not sure how do so.
My code:
HTML:
<p> ← Get Started</p>
<h3>or</h3>
<p> <i class="fa fa-code-fork"></i> Log In / Sign Up</p>
<p> <i class="fa fa-user-plus" ></i> Sign Up</p>
CSS:
#bottom-btn1{
margin-top: 10px;
margin: 20px;
margin-left: 340px;
display: inline-block;
float: left;
}
#bottom-btn2{
margin-top: 10px;
margin: 20px;
margin-right: 40px;
display: inline-block;
float: right;
}
JSFiddle link: https://jsfiddle.net/d2L7ynu3/
Thank you to the people that help me. It means alot :D
So this is a good opportunity to learn in CSS positioning; something I've fought with for years in order to learn. There's two main methods of achieving this effect but they have some gotchas. Using the following HTML (I've taken out the p tags).
Get Started
<span>or</span>
Log In
Sign Up
The inline-block method will work here, but we'll need to make a small change in order to get the links to line up next to each other. inline-block preserves white space, so you'll see a gap between the elements. Adding HTML comments between the elements will remove the white space (or you can just put the elements side-by-side without the line break for readability).
Get Started
<span>or</span>
Log In<!--
-->Sign Up
Now we can add CSS.
a{
display:inline-block;
}
#get_started{
width:100%;
}
#log_in, #sign_up{
width:50%;
}
If you didn't put the HTML comments in, you'll notice the sign_up link drop below the log_in because of the hidden white space.
If you go with the float method instead, then you'll need some extra markup.
Get Started
<span>or</span>
<p class="cf">
Log In
Sign Up
</p>
.cf:before, .cf:after{
content:"";
display:table;
}
.cf:after{
clear:both;
}
a{
display:block;
}
#get_started{
width:100%;
}
#log_in, #sign_up{
float:left;
width:50%;
}
The cf class stands for clearfix, which is a hack developed to help create height for parent elements with floated children.
The p element is making the buttons to be draw in different lines. You can try
p {
display: inline-block;
}
I suggest to place a selector class in those p so you will not need to overwrite the css for all th p elements
don't forget text-align : center; it saves most of the times.
i just tided up your code.. that might help you improve your coding.. just change the .wrap size if you do any changes on buttons. hope it helps
p, .back, h3 {
text-align: center;
}
.wrap {
margin: 0 auto;
width: 172px;
}
.btn {
float: left;
margin-left: 5px;
}
<p> ← Get Started
</p>
<h3>or</h3>
<p class="wrap">
<i class="fa fa-code-fork"></i> Log In / Sign Up
<i class="fa fa-user-plus" ></i> Sign Up
</p>
Try this
<div class="buttonbox">
<p> ← Get Started</p>
<h3>or</h3>
<p> <i class="fa fa-code-fork"></i> Log In / Sign Up</p>
<p> <i class="fa fa-user-plus" ></i> Sign Up</p>
</div>
CSS
.buttonbox {
text-align: center;
}
.buttonbox > p {
display: inline-block;
float: none!important;
}
don't call float: left; for those buttons.
HTML:
<div class="wrap">
← Get Started
<h3>or</h3>
<div>
<i class="fa fa-code-fork"></i> Log In / Sign Up
<i class="fa fa-user-plus" ></i> Sign Up
</div>
</div>
CSS:
.wrap {
max-width: 1000px; /* any size you want */
width: 96%; /* 960px */
margin: 0 auto;
text-align: center;
overflow: hidden;
padding: 1%;
}
.wrap h3 {
margin: 10px 0;
}
.wrap a {
padding: 20px 0;
}
.wrap > a {
border: 1px solid #ddd;
display: block;
width: 60%;
margin: 0 auto;
}
.wrap div a {
width: 48%;
float: left;
outline: 1px solid #ddd;
margin: 0 1%;
}
Result looks like this:
[BUTTON]
or
[Button 1] [Button2]
#bottom-btn1, #bottom-btn2{
padding: 10px;
border: solid black 3px;
background-color: #83D8B7;
color: #134A1E;
}
a{
text-decoration: none
}
<br>
<i class="fa fa-code-fork"></i> Log In / Sign Up
<i class="fa fa-user-plus" ></i> Sign Up