Overlay Input on <p> or <div> - html

Hopefully an easy question.
I have a <p> which has some styling on it to make it look like a UK registration plate.
I want to overlay an input field so the user can type in a reg.
Here's my fiddle
I'm struggling to get the overlay even when changing elements to absolute.
HTML:
<div>
<p class="reg">007 ABC</p>
<input id="vehicleReg" type="text" placeholder="Enter Vehicle Registration" />
</div>
CSS:
.reg {
background-color: #ec0;
background: -webkit-linear-gradient(#ec0, #ca0);
border-radius: 6px;
box-shadow: 0 1px 3px rgba(0,0,0,.75);
font-family: number_plate;
display: inline-block;
/*padding: 0 50px 0 100px;*/
width: 220px;
position: relative;
font-size: 28px;
font-weight: bold;
line-height: 50px;
/*margin: 100px;*/
color: black;
/* text-indent: 10px;*/
}
.reg::after {
background-color: rgba(255,255,255,.25);
color: #ec0;
content: "\25CC";
font-family: sans-serif;
font-size: 32px;
left: 0;
height: 50%;
line-height: 70px;
width: 100%;
padding-left: 14px;
position: absolute;
}
.vehicleReg {
position: absolute;
right: 13%;
bottom: 17px;
width: 64%;
height: 31px;
background-color: transparent;
text-align:center;
}
Thanks

A bit slow but the following will keep your little euro image and put the input above your top fade:
html
<div class="reg"><input id="vehicleReg" type="text" placeholder="Reg No" /></div>
css
.reg {
background-color: #ec0;
background: -webkit-linear-gradient(#ec0, #ca0);
border-radius: 6px;
box-shadow: 0 1px 3px rgba(0,0,0,.75);
display: inline-block;
/*padding: 0 50px 0 100px;*/
width: 220px;
position: relative;
/*margin: 100px;*/
color: black;
/* text-indent: 10px;*/
text-align:center
}
.reg::after {
text-align:left;
background-color: rgba(255,255,255,.25);
color: #ec0;
content: "\25CC";
font-family: sans-serif;
font-size: 32px;
top:0;
left: 0;
height: 50%;
line-height: 70px;
width: 100%;
padding-left: 14px;
position: absolute;
}
#vehicleReg {
width: 70%;
margin:auto;
background-color: transparent;
border:0;
font-family: number_plate;
font-weight: bold;
line-height: 50px;
font-size: 28px;
text-transform:uppercase;
position:relative; z-index:2;
}
Example

Additionally, you could style the placeholder text.
placeholder {
font-family: number_plate;
font-weight: bold;
font-size: 28px;
text-transform:uppercase;
color:black;
text-align:center;
}
JSFiddle

If you are positioning the input absolutely, you'll need to make it relative to a container div, in this case.
For example:
<div class="container">
<p class="reg">007 ABC</p>
<input id="vehicleReg" type="text" placeholder="Enter Vehicle Registration" />
</div>
.container {
position: relative;
}
See this:
DEMO

Do you mean something like this?
http://jsfiddle.net/zZUDN/8/
<div class="reg">
<input id="vehicleReg" type="text" placeholder="Enter Vehicle Registration" />
</div>
.reg {
border:none;
background-color: #ec0;
background: -webkit-linear-gradient(#ec0, #ca0);
border-radius: 6px;
box-shadow: 0 1px 3px rgba(0,0,0,.75);
font-family: number_plate;
display: inline-block;
/*padding: 0 50px 0 100px;*/
width: 220px;
position: relative;
font-size: 28px;
font-weight: bold;
line-height: 50px;
/*margin: 100px;*/
color: black;
/* text-indent: 10px;*/
}
.reg::after {
background-color: rgba(255,255,255,.25);
color: #ec0;
content: "\25CC";
font-family: sans-serif;
font-size: 32px;
left: 0;
height: 50%;
line-height: 70px;
width: 100%;
padding-left: 14px;
position: absolute;
}
#vehicleReg {
width:100%;
line-height:45px;
font-size:28px;
border:none;
background-color: transparent;
text-align:center;
}

Slightly unrelated but if you are after the user to type in a registration plate number look into using the input attribute pattern and give it a max length of 8 characters.
<input type="text" pattern="[A-Za-z0-9]{2}[0-9]{2}[ ][A-Za-z]{3}" maxlength="8" />
That enforces the pattern that a registration requires 4 alphanumeric characters a space and 3 characters.
(Part of HTML5 only works in latest browsers. IE are slow to catch up)

Change
.vehicleReg {
position: absolute;
right: 13%;
bottom: 17px;
width: 64%;
height: 31px;
background-color: transparent;
text-align:center;
}
to
#vehicleReg {
position: absolute;
right: 13%;
bottom: 17px;
width: 64%;
height: 31px;
background-color: transparent;
text-align:center;
}
vehicleReg is the id of the input field, not the class.

Related

Simplest solution to overlay div box on mouse-over?

working on this all night still no fix...
I have a link and when user hover mouse over it, it should display a box (div) under the link. The box should overlay whatever is under it. How can I do it using the most easyest way in pure-CSS way.
Thx Yummi
body {
background-color: #6B6B6B;
background: url(http://wizzfree.com/pix/bg.jpg) fixed;
background-size: 100% 100%;
background-repeat: no-repeat;
font-family: Arial;
color: darkgrey;
font-size: 14px;
line-height: .3;
letter-spacing: .5px;
margin: 50px;
}
/*............... emojis ...............*/
.emojis {
position: absolute;
padding: 25px 15px 10px 20px;
border-radius: 20px 0px 20px 20px;
background-color:rgba(0, 0, 0, .3);
}
.emojis2>img{
position:absolute;
left:100%;
top:0;
}
.smiley {
position: absolute;
top: 25px;
left: 430px;
}
/*... input message ...*/
input[type=text] {
width: 300px;
height: 50px;
border: none;
outline: none;
padding-left: 37px;
font-family: Arial;
color: white;
font-size: 16px;
font-weight: bold;
letter-spacing: 1.5px;
background-color:rgba(0, 0, 0, .3);
}
<!-- emojis button -->
<div class="smiley" style="height:42px;display:flex;"><img src="http://wizzfree.com/pix/smiley2.png" width="40">
<!-- input message -->
<form><input type="text" id="fname" name="fname" value="add emoji here" onFocus="this.value=''"></form>
</div>
<!-- emojis list -->
<div class="emojis" style="letter-spacing:3px;font-size:20px;">
<div class="emojis2"><img src="http://wizzfree.com/pix/bubble1.png" width="40" style="transform:scaleX(-1);"></div>
<br>πŸ˜ƒπŸ˜πŸ˜…πŸ€£πŸ˜‰πŸ˜ŠπŸ˜‡πŸ˜²πŸ˜³πŸ˜₯<p>
<br>πŸ₯°πŸ˜πŸ˜˜πŸ˜œπŸ€«πŸ€€πŸ˜ˆπŸ˜»πŸ™ˆπŸ™Š<p>
<br>πŸ’˜πŸ’•πŸ’žπŸ’ŒπŸ’‘ πŸ’πŸŒΉπŸŽ€πŸ¨πŸ­<p>
<br>πŸ’ƒπŸ„πŸ›€πŸ©πŸ‘‘πŸ¦πŸ¦„ πŸŽ πŸ§ΈπŸ’
</div>
With pure CSS, ugly hack is to hide the div first, show it later if mouse-over. Since the only link in your code is href="emojis.html", below example show moverover div with 'emojis.html' text:
body {
background-color: #6B6B6B;
background: url(http://wizzfree.com/pix/bg.jpg) fixed;
background-size: 100% 100%;
background-repeat: no-repeat;
font-family: Arial;
color: darkgrey;
font-size: 14px;
line-height: .3;
letter-spacing: .5px;
margin: 50px;
}
/*............... emojis ...............*/
.emojis {
position: absolute;
padding: 25px 15px 10px 20px;
border-radius: 20px 0px 20px 20px;
background-color: rgba(0, 0, 0, .3);
}
.emojis2>img {
position: absolute;
left: 100%;
top: 0;
}
.smiley {
position: absolute;
top: 25px;
left: 430px;
}
/*... input message ...*/
input[type=text] {
width: 300px;
height: 50px;
border: none;
outline: none;
padding-left: 37px;
font-family: Arial;
color: white;
font-size: 16px;
font-weight: bold;
letter-spacing: 1.5px;
background-color: rgba(0, 0, 0, .3);
}
a.special {
position: relative;
}
a.special div.hidediv {
background-color: white;
display: none;
position: absolute;
z-index: 100;
width: auto;
padding: 10 10 10 10;
}
a.special:hover div.hidediv {
display: block;
}
<!-- emojis button -->
<div class="smiley" style="height:42px;display:flex;"><a href="emojis.html" class="special"><img
src="http://wizzfree.com/pix/smiley2.png" width="40">
<div class="hidediv">emojis.html</div>
</a>
<!-- input message -->
<form><input type="text" id="fname" name="fname" value="add emoji here" onFocus="this.value=''"></form>
</div>
<!-- emojis list -->
<div class="emojis" style="letter-spacing:3px;font-size:20px;">
<div class="emojis2"><img src="http://wizzfree.com/pix/bubble1.png" width="40" style="transform:scaleX(-1);"></div>
<br>πŸ˜ƒπŸ˜πŸ˜…πŸ€£πŸ˜‰πŸ˜ŠπŸ˜‡πŸ˜²πŸ˜³πŸ˜₯<p>
<br>πŸ₯°πŸ˜πŸ˜˜πŸ˜œπŸ€«πŸ€€πŸ˜ˆπŸ˜»πŸ™ˆπŸ™Š
<p>
<br>πŸ’˜πŸ’•πŸ’žπŸ’ŒπŸ’‘ πŸ’πŸŒΉπŸŽ€πŸ¨πŸ­
<p>
<br>πŸ’ƒπŸ„πŸ›€πŸ©πŸ‘‘πŸ¦πŸ¦„ πŸŽ πŸ§ΈπŸ’
</div>

Color changes when selected as opposed to when hovered over

a {
text-decoration: none;
}
.header {
position: relative;
top: 1px;
left: 589px;
padding-top: 20px;
padding-bottom: 10px;
}
.subtitle {
position: relative;
right: 26px;
letter-spacing: 2px;
padding-top: 5px;
font-size: 21px;
font-family: arial;
font-weight: bold;
color: #6b6b6b;
text-shadow: 0px 0 #6b6b6b, 0 0px #6b6b6b, 2px 0 #6b6b6b, 0 0px #6b6b6b;
}
/* Menu*/
nav {
position: relative;
left: 210px;
height: 70px;
border-radius: 60px;
background: #dc67e9;
width: 1000px;
}
ul {
margin-left: 17%;
}
ul li {
display: inline-block;
line-height: 80px
}
ul li a {
text-decoration: none;
font-family: 'Coiny', cursive;
font-size: 19px;
color: white;
padding: 0 20px
}
ul li a:hover {
color: black;
}
.bannerimage {
margin-left: 5px;
margin-top: 4px;
}
.banner {
margin-top: 4px;
background-color: #dc67e9;
width: 100%;
height: 589px;
}
.bannerpromo1 {
position: relative;
bottom: 500px;
margin-left: 60px;
font-family: 'Lobster', cursive;
color: black;
text-shadow: -3px 0 white, 0 3px white, 3px 0 white, 0 -3px white;
font-size: 70px;
}
.bannerpromo2 {
position: relative;
bottom: 470px;
margin-left: -780px;
font-family: 'Lobster', cursive;
color: #585656;
text-shadow: -3px 0 white, 0 3px white, 3px 0 white, 0 -3px white;
font-size: 50px;
text-align: center;
}
.subscribebanner {
width: 250px;
height: 50px;
background-color: #dc67e9;
position: relative;
left: 190px;
bottom: 430px;
border: 4px solid white;
}
.subscribebannertext {
margin-left: 30px;
margin-top: 15px;
font-family: 'Coiny', cursive;
word-spacing: 2px;
font-size: 30px;
}
.howitworks {
font-size: 60px;
font-family: 'Lobster', cursive;
text-shadow: #a8a8a8 4px 6px;
margin-top: 50px;
position: relative;
left: 555px;
}
.subheaderbox1 {
position: relative;
margin-top: 20px;
right: 315px;
border-radius: 25px;
background: #adcae1;
width: 200px;
height: 100px;
}
.subheaderbox2 {
position: relative;
bottom: 100px;
left: 65px;
border-radius: 25px;
background: #adcae1;
width: 200px;
height: 100px;
}
.subheaderbox3 {
position: relative;
bottom: 200px;
left: 450px;
border-radius: 25px;
background: #adcae1;
width: 200px;
height: 100px;
}
.subheaders {
position: relative;
bottom: 275px;
font-size: 40px;
margin-left: -265px;
word-spacing: 250px;
letter-spacing: 3px;
color: white;
}
.box1 {
position: relative;
right: 370px;
bottom: 225px;
border-radius: 7px;
border: 5px dotted #dc67e9;
}
.box2 {
position: relative;
right: -15px;
bottom: 500px;
border-radius: 7px;
border: 5px dotted #dc67e9;
}
.box3 {
position: relative;
right: -405px;
bottom: 780px;
border-radius: 7px;
border: 5px dotted #dc67e9;
}
.step1 {
position: relative;
right: 932px;
bottom: 219px;
color: #666666;
font-size: 30px;
text-align: center;
}
.step2 {
position: relative;
right: 546px;
bottom: 493px;
color: #666666;
font-size: 30px;
text-align: center;
}
.step3 {
position: relative;
right: 153px;
bottom: 766px;
color: #666666;
font-size: 30px;
text-align: center;
}
.section1 {
position: relative;
margin-top: 20px;
bottom: 660px;
background-color: #adcae1;
margin-left: -570px;
width: 720px;
height: 500px;
text-align: center;
color: white;
}
.section2 {
position: relative;
left: 149px;
bottom: 660px;
background-color: #adcae1;
width: 720px;
height: 500px;
text-align: center;
color: white;
}
.section1title {
padding-top: 80px;
font-size: 70px;
}
.section1text {
font-size: 40px;
text-shadow: none;
color: #f0f0f0;
}
.section2title {
padding-top: 100px;
font-size: 70px;
}
.section2text {
font-size: 35px;
text-shadow: none;
color: #f0f0f0;
padding-left: 1px;
}
.imgsect1 {
margin-left: 148px;
position: relative;
bottom: 1660px
}
.imgsect2 {
position: relative;
bottom: 1668px;
right: 571px;
}
<!DOCTYPE html>
<html>
<head>
<title>SweetVie-Home-Page</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="indexstyle.css">
<link href="https://fonts.googleapis.com/css?family=Bungee+Shade|Lobster" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Coiny" rel="stylesheet">
<link rel="stylesheet" href="indexstyle.css">
<style>
a {
text-decoration: none;
}
</style>
</head>
<body>
<div class="topfiller"></div>
<div class="header">
<img src="images/logo.jpg" height="90" alt="SweetVieLogo">
<h2 class="subtitle">Vegan Baking Made Easy</h2>
</div>
<nav>
<ul>
<li>HOME</li>
<li>ABOUT US</li>
<li>COMMUNITY</li>
<li>FAQ</li>
<li>SUBSCRIBE</li>
</ul>
</nav>
<div class="banner">
<img class="bannerimage" src="images/mainpageimage.jpg" width="1414px" height="580px" alt="homepagebanner">
<h2 class="bannerpromo1">Premium Packaged <br>Dessert Baking Kits</h2>
<h2 class="bannerpromo2">High-quality,<br> organic and<br> vegan ingredients </h2>
<div class="subscribebanner">
<h3 class="subscribebannertext"> SUBSCRIBE</h3>
</div>
</div>
<div class="howitworks">
<h1>How It Works</h1>
<div class="subheaderbox1"></div>
<div class="subheaderbox2"></div>
<div class="subheaderbox3"></div>
<div class="subheaders">
<h2>Click Prepare Enjoy</h2>
</div>
<div>
<img class="box1" src="images/howitworks1.jpg" height="200" width="300" alt="step1">
</div>
<h3 class="step1">Select one of the three<br>subscription options</h3>
<div>
<img class="box2" src="images/howitworks2.jpg" height="200" width="300" alt="step2">
</div>
<h3 class="step2">Get involved and play<br>with your food</h3>
<div>
<img class="box3" src="images/howitworks3.jpg" height="200" width="300" alt="step3">
</div>
<h3 class="step3">Share or indulge in your<br>decadent and delicious treat</h3>
<div class="section1">
<h2 class="section1title">Food Time<br> Family Time</h2>
<br>
<p class="section1text">Timeless family fun,<br> sharing special treats with the <br> special people you love </p>
</div>
<div class="section2">
<h2 class="section2title">The Next Step</h2>
<br>
<p class="section2text">Health and desserts don't really<br> go together, with the exception of<br> SweetVie's sweets. Vegan desserts are the<br> baby steps you need for the best kind<br> of progress</p>
</div>
<div class="imgsect1">
<img src="images/homepagesection1.jpg" width="720px" height="500px" alt="Food Time Family Time.jpg">
</div>
<div class="imgsect2">
<img src="images/homepagesection2.jpg" width="720px" height="500px" alt="The Next Step.jpg">
</div>
</body>
</html>
I'm currently making a website for a school project that requires a menu bar. The menu bar changed to black whenever the cursor hovered over it previously, but recently stopped and now only changes color when it is selected/clicked.
I'm very new to html and css so I know my syntax or method of positioning my elements/divs may be poor.
But if there are any tips or guidance on what I should do to fix this problem, that would be great.
As pointed out in the comments, the div with class bannerpromo2 is getting in front of the menu, blocking hover and clicks.
As for the strange behavior you are getting when "inspecting", there is no magic there. Since bannerpromo2 is positioned relative to the bottom (it has bottom: 470px;), the position could be changing when you "inspect" it, because the developer panel opens from the bottom of your browser window, thus changing the bottom property of bannerpromo2.
If you want to see all of that in play, give bannerpromo2 a background color:
.bannerpromo2 {
background-color: green;
/* ...other props */
}

HTML/CSS: Display image in semicircle in top of modal box

I have a requirement of displaying the image/icon on top of the modal box in a semicircle. Though I have achieved it with the help of below code, but the only issue is whenever my form in the modal box goes for a validation check, displaying any error, my semicircle doesn't get adjusted accordingly, rather it stays at its position. Here, I have attached the screen shot of what exactly I am looking for and HTML/css code I have used to display the semicircle with image/icon at the top.
.modal {
font-family: Avenir-Medium;
font-size: 16px;
font-weight: 900;
font-style: normal;
font-stretch: normal;
display: block;
/*Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.3);
/* Black w/ opacity */
-webkit-animation-name: slideIn;
/* Fade in the background */
-webkit-animation-duration: 2.0s;
/* Fade in the background */
;
}
/* Modal Content */
.modal-content {
position: fixed;
bottom: 0;
background-color: #fefefe;
width: 92%;
left: 14px;
-webkit-animation-name: fadeIn;
-webkit-animation-duration: 0.5s;
border-radius: 16px 16px 0px 0px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border: none;
top: auto;
}
.modal-wrapper {
line-height: 45px;
border: 1px solid #e7e9ea;
border-radius: 6px 6px 0px 0px;
background-color: white;
margin: auto;
}
.modal-wrapper::after {
background: url("../../../../images/mobile/img-payment_38.png") no-repeat 22px 10px;
background-size: 50%;
background-color: #fff;
content: '';
width: 78px;
height: 45px;
position: absolute;
left: 0;
right: 0;
margin: auto;
border-radius: 78px 78px 0 0;
border-left: 1px solid #e7e9ea;
border-top: 1px solid #e7e9ea;
border-right: 1px solid #e7e9ea;
border-bottom: 3px solid white;
bottom: 300px;
}
.close-btn {
position: absolute;
vertical-align: top;
top: 4px;
left: 320px;
width: 18px;
height: 18px;
}
.container-div-creditCard {
margin: 12px 20px 0px 20px;
}
.container-div-creditCard>img {
position: absolute;
bottom: 154px;
right: 30px;
}
.credit-card-modal-label {
font-family: AvenirHeavy;
font-size: 13px;
color: #1d3444;
text-align: center;
font-weight: 200;
height: 24px;
margin-left: 31px;
}
.input-modal {
width: 100%;
height: 44px;
}
.input-spacing {
margin-top: 15px;
}
.credit-input-modal {
border: solid 1px #e7e9ea;
border-radius: 5px;
font-family: Avenir-Book;
font-size: 14px;
font-weight: normal;
color: #8589a1;
line-height: initial;
padding: 13px 42px 12px 15px;
}
.credit-expiry-input-modal {
padding: 13px 27px 12px 10px;
border: solid 1px #e7e9ea;
border-radius: 5px;
font-family: Avenir-Book;
font-size: 14px;
font-weight: normal;
color: #8589a1;
display: inline-block;
line-height: initial;
width: 65%;
height: 44px;
}
.credit-cvc-input-modal {
width: 30%;
padding: 17px 5px 12px 10px;
border: solid 1px #e7e9ea;
border-radius: 5px;
font-family: Avenir-Book;
font-size: 14px;
font-weight: normal;
color: #8589a1;
line-height: initial;
height: 44px;
}
.cvvDisc {
-webkit-text-security: disc;
}
.credit-submit-button {
width: 100%;
padding: 13px;
margin-top: 15px;
border: solid 1px #e7e9ea;
border-radius: 5px 5px 5px 5px;
background: linear-gradient(to right, #e32490, #ed1a3d);
color: white;
margin-bottom: 20px;
font-family: Avenir-Book;
font-weight: normal;
font-size: 14px;
line-height: initial;
}
.errorMsg {
font-family: Avenir-Book;
font-weight: normal;
color: #ED1A3D;
font-size: 12px;
}
<div id="modalCCDetails" class="modal">
<div class="modal-content modal-wrapper">
<div class="container-div-creditCard">
<label class="credit-card-modal-label">ENTER YOUR CREDIT CARD DETAILS</label>
<input name="cc_name" class="input-modal credit-input-modal" type="text" placeholder="Name printed on Credit Card" onChange={this.handleUserInput} />
<span class="errorMsg"></span>
<input name="cc_number" class="input-modal credit-input-modal input-spacing" type="tel" maxLength="16" onKeyPress={(e)=> this.handleCCOnKeyPress(e)} placeholder="16 digit credit card number" />
<span class="errorMsg"></span>
<input name="cc_expDate" class="credit-expiry-input-modal" type="text" placeholder="Expiry MM-YYYY" />
<div class="device-divider" />
<input name="cc_cvc" class="credit-cvc-input-modal cvvDisc" type="tel" placeholder="CVC" maxLength="3" />
<span class="errorMsg"></span>
</div>
<button class="credit-submit-button">Submit Payment</button>
</div>
</div>
</div>
NOTE: This is a mobile view screenshot
Just adjust your css code into something like this:
.modal-wrapper::after {
background: url("../../../../images/mobile/img-payment_38.png") no-repeat 22px 10px;
background-size: 50%;
background-color: #fff;
content: '';
width: 78px;
height: 45px;
position: absolute;
left: 0;
right: 0;
margin: auto;
border-radius: 78px 78px 0 0;
border: 1px solid #e7e9ea;
border-bottom: 3px`enter code here` solid white;
top: -48px;
}
Just remove the bottom: 300px; and replace with top: -48px; or any value that you want.
please add top:-15px; and removed bottom:300px; in class .modal-wrapper::after { top: -15px; }, u will see the image move up

Create three vertical dots (ellipsis) inside a circle

I want to make a circle <div>, like this image:
I have tried this code.
.discussion:after {
content: '\2807';
font-size: 1em;
background: #2d3446;
width: 20px;
height: 20px;
border-radius: 100px;
color:white;
}
<div class="discussion"></div>
How can I do this correctly?
You could just use :after pseudo-element with content: 'β€’β€’β€’' and transform: rotate. Note that this is the bullet HTML special character β€’, or \u2022.
div {
position: relative;
background: #3F3C53;
width: 50px;
height: 50px;
color: white;
border-radius: 50%;
box-shadow: 0px 0px 15px 1px #4185BC;
margin: 50px;
}
div:after {
content: 'β€’β€’β€’';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(90deg);
font-size: 15px;
letter-spacing: 4px;
margin-top: 2px;
}
<div></div>
Improving on Nenad Vracar's answer, here's one that doesn't use text (so it's font-independent) and everything is centered nicely:
div {
position: relative;
background: #3F3C53;
width: 50px;
height: 50px;
border-radius: 50%;
box-shadow: 0px 0px 15px 1px #4185BC;
margin: 50px;
}
div:after {
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 2px;
height: 2px;
margin-left: -1px;
margin-top: -1px;
background-color: white;
border-radius: 50%;
box-shadow: 0 0 0 2px white, 0 11px 0 2px white, 0 -11px 0 2px white;
}
<div></div>
Yet another answer, same as others except:
it uses the vertical ellipsis character (U+22EE)
text-align and line-height to center the content
does not use any pixel value
.discussion:after {
content: "\22EE";
/* box model */
display: inline-block;
width: 1em;
height: 1em;
/* decoration */
color: #FFFFFF;
background-color: #000000;
border-radius: 50%;
/* center align */
line-height: 1;
text-align: center;
}
<div class="discussion"></div>
<div class="discussion" style="font-size: 2em;"></div>
<div class="discussion" style="font-size: 3em;"></div>
<div class="discussion" style="font-size: 4em;"></div>
Note that U+2807 is actually a Braille pattern and the dots are not supposed to be centered.
Use this code.
.discussion {
width: 20px;
height: 20px;
border-radius: 50%;
position: relative;
background: #2d3446;
}
.discussion:after {
content: '\22EE';
font-size: 1em;
font-weight: 800;
color: white;
position: absolute;
left: 7px;
top: 1px;
}
<div class="discussion"></div>
Hope this helps!
I hope this is what you wanted! Otherwise feel free to ask.
.discussion{
display: block; /* needed to make width and height work */
background: #2d3446;
width: 25px;
height: 25px;
border-radius: 100px;
display: flex;
align-items: center;
justify-content: center;
}
.discussion:after {
content: '\2807';
font-size: 1em;
color: white;
margin-left: 15%;
}
<div class="discussion"></div>
Using text dots
.discussion{
width:50px;
height:50px;
text-align:center;
background-color:black;
border: 2px solid red;
border-radius: 100%;
}
.discussion text{
writing-mode: tb-rl;
margin-top:0.4em;
margin-left:0.45em;
font-weight:bold;
font-size:2em;
color:white;
}
<div class="discussion"><text>...</text></div>
.discussion:after {
content: '\2807';
font-size: 1em;
display: inline-block;
text-align: center;
background: #2d3446;
width: 20px;
height: 20px;
border-radius: 50%;
color: white;
padding:3px;
}
<div class="discussion"></div>
I have deleted (i found how to do it) all my post, the following code works for 3 vertical dot into a black circle
.discussion:after{
display:inline-block;
content:'\22EE';
line-height:100%;
border-radius: 50%;
margin-left:10px;
/********/
font-size: 1em;
background: #2d3446;
width: 20px;
height: 20px;
color:white;
}
<div class="discussion"></div>

how to add button inside input in joomla

This is how my input and button looks like. The CSS code looks like this:
button._searchfrontpage
{
margin: 0 auto;
background: #333;
height: 53px;
width: 70px;
border-radius: 6px;
line-height: normal;
color: #eee;
font-weight: 400;
letter-spacing: 2px;
border: 0px;
display: block;
font-size: 18px;
}
.sp-module_searchfrontpage input[type="text"] {
background: #f0dbc5;
height: 53px;
width: 50%;
margin: 0 auto;
border-radius: 6px;
margin-bottom: 40px;
line-height: normal;
color: #444;
font-weight: 400;
letter-spacing: 2px;
border: 0px;
display: block;
}
I dont seem to figure out a way to drag the grey button into the right side of my input box. Are there someone who can figure me an idea to work from?
EDIT: after implementing the code #Jai gave me, it looks fine, but when i make the browser smaller, it gets out of its place and looks like this:
Obviously its like that, because the input width is 50%. are there any solutions for that?
For your div:
.sp-module_searchfrontpage{
/* other CSS as is*/
position: relative;
}
Now the button:
button._searchfrontpage {
background: #333;
height: 53px;
width: 70px;
border-radius: 6px;
line-height: normal;
color: #eee;
font-weight: 400;
letter-spacing: 2px;
border: 0px;
display: block;
font-size: 18px;
/* add these properties */
position: absolute;
top:0;
right:0;
z-index:100; /* <=====choose the correct value*/
}
But you have to make sure that the parent div has same height as the input and button does and relatively positioned.
If it is not possible then you can wrap them into another div or better with label and style it with same height property of the input and button but the div still needs the relative position and button should be absolutely positioned. I would do it with label:
<label>
<input type="text" />
<button>search</button>
</label>
Then in the CSS:
.sp-module_searchfrontpage label{
width: 100%;
height: 53px;
position: relative;
}
button._searchfrontpage {
background: #333;
height: 53px;
width: 70px;
border-radius: 6px;
line-height: normal;
color: #eee;
font-weight: 400;
letter-spacing: 2px;
border: 0px;
display: block;
font-size: 18px;
/* add these properties */
position: absolute;
top:0;
right:0;
z-index:100; /* <=====choose the correct value*/
}