css display webkit box in table - html

In below Image td A and td B has "lined" and "thick" class. When I apply lines and thickes to BCD the format in table becomes messed-up. Why?
All images and code are below.
When I add "lined" and "thick" class in td C. It display like this:
When I add "lined" and "thick" class in td D. It will display like this:
.
Forgive for my poor English. I'm Taiwanese.
My code is in image and script-form for Css and HTML here below:
.
#import url(https://fonts.googleapis.com/css?family=Open+Sans);
#import url(https://fonts.googleapis.com/css?family=Fira+Sans);
#import url(https://fonts.googleapis.com/css?family=Montserrat);
#import url(https://fonts.googleapis.com/css?family=Droid+Sans);
.button-Blue {
background-color: #3498DB;
box-shadow: 0px 15px 0px 0px #258cd1;
text-align: center;
padding: 10px;
padding-bottom: 5px;
color: white;
margin-top: 30px;
margin-bottom: 20px;
font-weight: bold;
display: block;
width: 200px;
text-decoration: none
}
.button-Blue:hover {
color: white;
background-color: #49abed;
box-shadow: 0px 15px 0px 0px #439cd8;
-webkit-transition-duration: 0.4s;
text-decoration: none
}
.button-Blue:active {
color: white;
background-color: #49abed;
transform: translateY(4px);
box-shadow: 0px 15px 0px 0px #439cd8;
-webkit-transition-duration: 0.1s;
text-decoration: none
}
.button-Yellow {
background-color: #edeb5e;
box-shadow: 0px 15px 0px 0px #d6d34f;
text-align: center;
color: black;
margin-bottom: 15px;
font-weight: bold;
display: block;
text-decoration: none
}
.button-Yellow:hover {
color: black;
background-color: #f4f273;
box-shadow: 0px 15px 0px 0px #e0df64;
-webkit-transition-duration: 0.4s;
text-decoration: none
}
.button-Yellow:active {
color: black;
background-color: #f4f273;
transform: translateY(4px);
box-shadow: 0px 15px 0px 0px #e0df64;
-webkit-transition-duration: 0.1s;
text-decoration: none
}
.tableShadow {
box-shadow: 0px 3px 2px #999;
}
.button-Green {
background-color: #51d166;
box-shadow: 0px 15px 0px 0px #4dc160;
text-align: center;
color: black;
margin-bottom: 15px;
font-weight: bold;
display: block;
text-decoration: none
}
.button-Green:hover {
color: black;
background-color: #62db76;
box-shadow: 0px 15px 0px 0px #5ace6d;
-webkit-transition-duration: 0.4s;
text-decoration: none
}
.button-Green:active {
color: black;
background-color: #62db76;
transform: translateY(4px);
box-shadow: 0px 15px 0px 0px #5ace6d;
-webkit-transition-duration: 0.1s;
text-decoration: none
}
.button-Orange {
background-color: #e0a32a;
box-shadow: 0px 15px 0px 0px #cc9324;
text-align: center;
color: black;
margin-bottom: 15px;
font-weight: bold;
display: block;
text-decoration: none
}
.button-Orange:hover {
color: black;
background-color: #edb038;
box-shadow: 0px 15px 0px 0px #db9e29;
-webkit-transition-duration: 0.4s;
text-decoration: none
}
.button-Orange:active {
color: black;
background-color: #edb038;
transform: translateY(4px);
box-shadow: 0px 15px 0px 0px #db9e29;
-webkit-transition-duration: 0.1s;
text-decoration: none
}
.button-White {
background-color: #dee2e2;
box-shadow: 0px 15px 0px 0px #d6dbdb;
text-align: center;
color: black;
margin-bottom: 15px;
font-weight: bold;
display: block;
text-decoration: none
}
.button-White:hover {
color: black;
background-color: #eaeded;
box-shadow: 0px 15px 0px 0px #dee0e0;
-webkit-transition-duration: 0.4s;
text-decoration: none
}
.button-White:active {
color: black;
background-color: #eaeded;
transform: translateY(4px);
box-shadow: 0px 15px 0px 0px #dee0e0;
-webkit-transition-duration: 0.1s;
text-decoration: none
}
.button-White {
background-color: #dee2e2;
box-shadow: 0px 15px 0px 0px #d6dbdb;
text-align: center;
color: black;
margin-bottom: 15px;
font-weight: bold;
display: block;
text-decoration: none
}
.button-White:hover {
color: black;
background-color: #eaeded;
box-shadow: 0px 15px 0px 0px #dee0e0;
-webkit-transition-duration: 0.4s;
text-decoration: none
}
.button-White:active {
color: black;
background-color: #eaeded;
transform: translateY(4px);
box-shadow: 0px 15px 0px 0px #dee0e0;
-webkit-transition-duration: 0.1s;
text-decoration: none
}
.button-Purple {
background-color: #aa6ae2;
box-shadow: 0px 15px 0px 0px #985dcc;
text-align: center;
color: black;
margin-bottom: 15px;
font-weight: bold;
display: block;
text-decoration: none
}
.button-Purple:hover {
color: black;
background-color: #ba7bf2;
box-shadow: 0px 15px 0px 0px #ac70e0;
-webkit-transition-duration: 0.4s;
text-decoration: none
}
.button-Purple:active {
color: black;
background-color: #ba7bf2;
transform: translateY(4px);
box-shadow: 0px 15px 0px 0px #ac70e0;
-webkit-transition-duration: 0.1s;
text-decoration: none
}
.button-border-Blue {
cursor: pointer;
border-radius: 5px;
text-decoration: none;
padding: 7px;
font-size: 22px;
transition: .3s;
-webkit-transition: .3s;
-moz-transition: .3s;
-o-transition: .3s;
display: inline-block;
color: #55acee;
border: 2px #55acee solid;
text-align:center;
}
.button-border-Blue:hover {
background-color: #55acee;
color: #fff;
text-decoration: none
}
.button-border-Red {
cursor: pointer;
border-radius: 5px;
text-decoration: none;
padding: 7px;
font-size: 22px;
transition: .3s;
-webkit-transition: .3s;
-moz-transition: .3s;
-o-transition: .3s;
display: inline-block;
color: #e74c3c;
border: 2px #e74c3c solid;
text-align: center;
}
.button-border-Red:hover {
color: #fff;
background-color: #e74c3c;
text-decoration: none
}
.lined.thick {
border: solid 4px #41403E;
-ms-flex-item-align: center;
align-self: center;
background: transparent;
padding: 1rem 1rem;
text-align: center;
font-size: 18px;
-webkit-transition: all .5s ease;
transition: all .5s ease;
color: #41403E;
font-size: 2rem;
letter-spacing: 1px;
outline: none;
-webkit-box-shadow: 20px 38px 34px -26px rgba(0, 0, 0, 0.2);
box-shadow: 20px 38px 34px -26px rgba(0, 0, 0, 0.2);
border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
width: 100%;
min-height: 100%;
}
<!-- begin snippet: js hide: false console: true babel: false -->
#model IEnumerable<WebApplication8.Models.Quest>
#{
ViewBag.Title = "Index";
}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
table {
width: 100%;
border-collapse: collapse;
}
/* Zebra striping */
tr:nth-of-type(odd) {
background: #eee;
}
th {
background: #333;
color: white;
font-weight: bold;
padding:6px;
}
td, th {
border: 1px solid #ccc;
text-align: center;
}
.remark {
word-break: break-all;
overflow-x: hidden;
max-width: 100px;
}
.scrollDiv{
overflow:scroll;
max-height:300px;
}
##media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) {
/* Force table to not be like tables anymore */
table, thead, tbody, th, td, tr {
display: block;
}
/* Hide table headers (but not display: none;, for accessibility) */
thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}
tr {
border: 1px solid #ccc;
}
.remark {
max-width: 100%;
}
td {
/* Behave like a "row" */
border: none;
border-bottom: 1px solid #eee;
position: relative;
padding-left: 30%;
}
td:before {
/* Now like a table header */
position: absolute;
/* Top/left values mimic padding */
top: 6px;
left: 6px;
width: 45%;
}
/*
Label the data
*/
td:nth-of-type(1):before {
content: "試卷名稱";
font-weight: bold;
}
td:nth-of-type(2):before {
content: "操作";
font-weight: bold;
}
td:nth-of-type(3):before {
content: "題目數量";
font-weight: bold;
}
td:nth-of-type(4):before {
content: "備註";
font-weight: bold;
}
td:nth-of-type(5):before {
content: "狀態";
font-weight: bold;
}
}
.coordinate {
width: 64px;
float: left;
margin-left: 5px;
padding: 2px;
white-space: pre-line
}
.coordinate2{
margin-bottom:0px;
}
</style>
<link rel="stylesheet" href="~/MyCss/style.css"/>
<div class="">
<p>
<a style="font-size:20px;text-decoration:none;color:white" class="button-Blue" href="/Quests/Create?ClassId=#ViewBag.ClassId">新增試卷</a><!--test-->
</p>
#if (ViewBag.authError != null)
{
<h2 style="color:darkred">權限不足無法進入</h2>
}
<div class="scrollDiv">
<table class="tableShadow">
<thead><tr><th>試卷名稱</th><th>操作</th><th>題目數量</th><th>備註</th><th>狀態</th></tr></thead>
#foreach (var item in Model.Where(x => x.clas.id == ViewBag.ClassId && x.status.Equals("未作答")))
{
<tr>
<td style="width:inherit" class="lined thick">
#Html.DisplayFor(modelItem => item.name)
</td>
<td style="width:25%">
#Html.ActionLink("試卷\n列表", "Edit", new { id = item.id },new { #class = "button-Green coordinate" })
#Html.ActionLink("試卷\n內容", "Details", new { id = item.id }, new { #class = "button-Orange coordinate" })
#Html.ActionLink("題目\n列表", "QuestionsList", new { id = item.id }, new { #class = "button-Purple coordinate" })
#Html.ActionLink("刪除\n試卷", "Delete", new { id = item.id }, new { #class = "button-White coordinate" })
</td>
<td class="lined thick" style="width:inherit">
#item.questions.Count()
</td>
<td class="lined thick" >
#if (item.remark == null)
{
#:nothing
}
else
{
#item.remark
}
</td>
<td class="lined thick">
#item.status
</td>
</tr>
}
</table>
</div>
<p>
<h2 class="lined thick"><b>已作答試卷</b></h2>
</p>
<div class="scrollDiv">
<table>
<thead><tr><th>試卷名稱</th><th>操作</th><th>題目數量</th><th>備註</th><th>狀態</th></tr></thead>
#foreach (var item in Model.Where(x => x.clas.id == ViewBag.ClassId && x.status.Equals("已作答")))
{
<tr>
<td style="width:40%" class="lined thick">
#Html.DisplayFor(modelItem => item.name)
</td>
<td style="width:25%">
#Html.ActionLink("編輯試卷", "Edit", new { id = item.id }) |
#Html.ActionLink("試卷內容", "Details", new { id = item.id }) |
#Html.ActionLink("題目列表", "QuestionsList", new { id = item.id })
|#Html.ActionLink("刪除試卷", "Delete", new { id = item.id })
</td>
<td class="lined thick">
#item.questions.Count()
</td>
<td class="remark lined thick" style="width:20%">
#if (item.remark == null)
{
#:nothing
}
else
{
#item.remark
}
</td>
<td class="lined thick">
#item.status
</td>
</tr>}
</table>
</div>
<div>
#Html.ActionLink("返回", "ClassIndex", new { id = ViewBag.CourseId })
</div>
</div>
#section Scripts {
#Scripts.Render("~/bundles/jqueryval")
<script src="~/Scripts/jquery.signalR-2.2.2.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script>
function myFunction() {
var x = $(window).width();
document.getElementById("demo").innerHTML = x;
}
</script>
}
Image that I want to display
The result that I want is I want this two td display like left td.
But when I add the "lined" and "thick" class to this two td. The table will display like [Image2],[Image3]

It seems that you are probably setting the css class to tr instead of td. Please correct and it should resolve the error.
Please provide the code and I can check it

Maybe you can try to add on a div inside
Like this:
<td style="width:40%">
<div class="lined thick">
#Html.DisplayFor(modelItem => item.name)
</div>
</td>
Because the webkit is overwriting the display for table, while in table, display should be table cell. So try not to overwrite the table cell

Related

How to associate label with checkbox but not using "for=id"

i have this code:
<li><input type="checkbox" id="checkboxThree" value="Alergia3" ><label for="checkboxThree">Alergia 1</label></li>
<li><input type="checkbox" id="checkboxFour" value="Alergia4"><label for="checkboxFour">Alergia 1</label></li>
<li><input type="checkbox" id="checkboxFive" value="Alergia5"><label for="checkboxFive">Alergia 1</label></li>
<li><input type="checkbox" id="checkboxSix" value="Alergia6" ><label for="checkboxSix">Alergia 1</label></li>
But I don't want to use "id" and "for" because I have to do other thing later and I can't use them. I have see this question: Possible to associate label with checkbox without using "for=id"? and I have triet what the first peson says:
<li><label ><input type="checkbox" name="Alergia1">Alergia 1</label></li>
<li><label ><input type="checkbox" name="Alergia2" >Alergia 1</label></li>
But It does not work either.
This is the entire project to see that it does not work:
.font-robo {
font-family: "Roboto", "Arial", "Helvetica Neue", sans-serif;
}
.font-poppins {
font-family: "Poppins", "Arial", "Helvetica Neue", sans-serif;
}
html {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
* {
padding: 0;
margin: 0;
}
*, *:before, *:after {
-webkit-box-sizing: inherit;
-moz-box-sizing: inherit;
box-sizing: inherit;
}
/* ==========================================================================
#GRID
========================================================================== */
/* ==========================================================================
#BOX-SIZING
========================================================================== */
/**
* More sensible default box-sizing:
* css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice
*/
/* ==========================================================================
#RESET
========================================================================== */
/**
* A very simple reset that sits on top of Normalize.css.
*/
body,
h1, h2, h3, h4, h5, h6,
blockquote, p, pre,
dl, dd, ol, ul,
figure,
hr,
fieldset, legend {
margin: 0;
padding: 0;
}
/**
* Remove trailing margins from nested lists.
*/
li > ol,
li > ul {
margin-bottom: 0;
}
/**
* Remove default table spacing.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
/**
* 1. Reset Chrome and Firefox behaviour which sets a `min-width: min-content;`
* on fieldsets.
*/
fieldset {
min-width: 0;
/* [1] */
border: 0;
}
button {
outline: none;
background: none;
border: none;
}
/* ==========================================================================
#PAGE WRAPPER
========================================================================== */
.page-wrapper {
height:100vh;
}
body {
font-family: "Poppins", "Arial", "Helvetica Neue", sans-serif;
font-weight: 400;
font-size: 14px;
}
h1, h2, h3, h4, h5, h6 {
font-weight: 400;
}
h1 {
font-size: 36px;
}
h2 {
font-size: 30px;
color: #00929a !important;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 15px;
}
h6 {
font-size: 13px;
}
/* ==========================================================================
#BACKGROUND
========================================================================== */
.bg-blue {
background: #2c6ed5;
}
.bg-red {
background: #fa4251;
}
.bg-gra-01 {
background: -webkit-gradient(linear, left bottom, left top, from(#00929a), to(#034649));
background: -webkit-linear-gradient(bottom, #00929a 0%, #034649 100%);
background: -moz-linear-gradient(bottom, #00929a 0%, #034649 100%);
background: -o-linear-gradient(bottom, #00929a 0%, #034649 100%);
background: linear-gradient(to top, #00929a 0%, #034649 100%);
}
.bg-gra-02 {
background: -webkit-gradient(linear, left bottom, right top, from(#00929a), to(#034649));
background: -webkit-linear-gradient(bottom left, #00929a 0%, #034649 100%);
background: -moz-linear-gradient(bottom left, #00929a 0%, #034649 100%);
background: -o-linear-gradient(bottom left, #00929a 0%, #034649 100%);
background: linear-gradient(to top right, #00929a 0%, #034649 100%);
}
/* ==========================================================================
#CHECKBOX
========================================================================== */
.container {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 13px;
}
ul.ks-cboxtags {
list-style: none;
margin-bottom: 20px;
}
ul.ks-cboxtags li{
display: inline;
}
ul.ks-cboxtags li label{
display: inline-block;
background-color: rgba(255, 255, 255, .9);
border: 2px solid rgba(139, 139, 139, .3);
color: #adadad;
border-radius: 25px;
white-space: nowrap;
margin: 3px 0px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
transition: all .2s;
}
ul.ks-cboxtags li label {
padding: 20px 20px;
cursor: pointer;
margin:20px;
}
ul.ks-cboxtags li label::before {
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
font-family: "Font Awesome 5 Free";
font-weight: 900;
font-size: 12px;
padding: 20px;
transition: transform .3s ease-in-out;
}
ul.ks-cboxtags li input[type="checkbox"]:checked + label {
border: 2px solid #00929a;
background-color: #00929a;
color: #fff;
transition: all .2s;
}
ul.ks-cboxtags li input[type="checkbox"] {
display: absolute;
}
ul.ks-cboxtags li input[type="checkbox"] {
position: absolute;
width: 60vh;
opacity: 0;
}
ul.ks-cboxtags li input[type="checkbox"]:focus + label {
border: 2px solid #034649;
}
/* ==========================================================================
#SPACING
========================================================================== */
.p-t-100 {
padding-top: 100px;
}
.p-t-130 {
padding-top: 130px;
}
.p-t-180 {
padding-top: 180px;
}
.p-t-20 {
padding-top: 20px;
}
.p-t-15 {
padding-top: 15px;
}
.p-t-10 {
padding-top: 10px;
}
.p-t-30 {
padding-top: 30px;
}
.p-b-100 {
padding-bottom: 100px;
}
.m-r-45 {
margin-right: 45px;
}
/* ==========================================================================
#WRAPPER
========================================================================== */
.wrapper {
margin: 0 auto;
}
.wrapper--w960 {
max-width: 960px;
}
.wrapper--w780 {
max-width: 780px;
}
.wrapper--w680 {
max-width: 680px;
}
/* ==========================================================================
#BUTTON
========================================================================== */
.btn {
display: inline-block;
line-height: 50px;
padding: 0 50px;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
cursor: pointer;
font-size: 18px;
color: #fff;
font-family: "Poppins", "Arial", "Helvetica Neue", sans-serif;
}
.btn--radius {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.btn--radius-2 {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.btn--pill {
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
}
.btn--green {
background: #00929a;
}
.btn--green:hover {
background: #00929a;
}
.btn--blue {
background: #034649;
}
.btn--blue:hover {
background: #034649;
}
/* ==========================================================================
#DATE PICKER
========================================================================== */
td.active {
background-color: #034649;
}
input[type="date" i] {
padding: 14px;
}
.table-condensed td, .table-condensed th {
font-size: 14px;
font-family: "Roboto", "Arial", "Helvetica Neue", sans-serif;
font-weight: 400;
}
.daterangepicker td {
width: 40px;
height: 30px;
}
.daterangepicker {
border: none;
-webkit-box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
display: none;
border: 1px solid #e0e0e0;
margin-top: 5px;
}
.daterangepicker::after, .daterangepicker::before {
display: none;
}
.daterangepicker thead tr th {
padding: 10px 0;
}
.daterangepicker .table-condensed th select {
border: 1px solid #ccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
font-size: 14px;
padding: 5px;
outline: none;
}
/* ==========================================================================
#FORM
========================================================================== */
input {
outline: none;
margin: 0;
border: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
width: 100%;
font-size: 14px;
font-family: inherit;
}
.input--style-4 {
line-height: 50px;
background: #fafafa;
-webkit-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
-moz-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
padding: 0 20px;
font-size: 16px;
color: #666;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.input--style-4::-webkit-input-placeholder {
/* WebKit, Blink, Edge */
color: #666;
}
.input--style-4:-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
color: #666;
opacity: 1;
}
.input--style-4::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #666;
opacity: 1;
}
.input--style-4:-ms-input-placeholder {
/* Internet Explorer 10-11 */
color: #666;
}
.input--style-4:-ms-input-placeholder {
/* Microsoft Edge */
color: #666;
}
.label {
font-size: 16px;
color: #555;
text-transform: capitalize;
display: block;
margin-bottom: 5px;
}
.radio-container {
display: inline-block;
position: relative;
padding-left: 30px;
cursor: pointer;
font-size: 16px;
color: #666;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.radio-container input {
position: absolute;
opacity: 0;
cursor: pointer;
}
.radio-container input:checked ~ .checkmark {
background-color: #e5e5e5;
}
.radio-container input:checked ~ .checkmark:after {
display: block;
}
.radio-container .checkmark:after {
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 12px;
height: 12px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
background: #00929a;
}
.checkmark {
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
left: 0;
height: 20px;
width: 20px;
background-color: #e5e5e5;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-webkit-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
-moz-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
}
.checkmark:after {
content: "";
position: absolute;
display: none;
}
.input-group {
position: relative;
margin-bottom: 22px;
}
.input-group-icon {
position: relative;
}
.input-icon {
position: absolute;
font-size: 18px;
color: #999;
right: 18px;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
cursor: pointer;
}
/* ==========================================================================
#SELECT2
========================================================================== */
.select--no-search .select2-search {
display: none !important;
}
.rs-select2 .select2-container {
width: 100% !important;
outline: none;
background: #fafafa;
-webkit-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
-moz-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.08);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.rs-select2 .select2-container .select2-selection--single {
outline: none;
border: none;
height: 50px;
background: transparent;
}
.rs-select2 .select2-container .select2-selection--single .select2-selection__rendered {
line-height: 50px;
padding-left: 0;
color: #555;
font-size: 16px;
font-family: inherit;
padding-left: 22px;
padding-right: 50px;
}
.rs-select2 .select2-container .select2-selection--single .select2-selection__arrow {
height: 50px;
right: 20px;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.rs-select2 .select2-container .select2-selection--single .select2-selection__arrow b {
display: none;
}
.rs-select2 .select2-container .select2-selection--single .select2-selection__arrow:after {
font-family: "Material-Design-Iconic-Font";
content: '\f2f9';
font-size: 24px;
color: #999;
-webkit-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
transition: all 0.4s ease;
}
.rs-select2 .select2-container.select2-container--open .select2-selection--single .select2-selection__arrow::after {
-webkit-transform: rotate(-180deg);
-moz-transform: rotate(-180deg);
-ms-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
transform: rotate(-180deg);
}
.select2-container--open .select2-dropdown--below {
border: none;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
border: 1px solid #e0e0e0;
margin-top: 5px;
overflow: hidden;
}
.select2-container--default .select2-results__option {
padding-left: 22px;
}
/* ==========================================================================
#TITLE
========================================================================== */
.title {
font-size: 30px;
font-weight: 400;
margin-bottom: 20px;
}
/*========================================================================== */
.frase {
font-size: 18px;
color: #525252;
font-weight: 400;
margin-bottom: 40px;
}
/* ==========================================================================
#CARD
========================================================================== */
.card {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background: #fff;
}
.card-4 {
background: #fff;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
-moz-box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.15);
}
.card-4 .card-body {
padding: 17px 50px;
padding-bottom: 55px;
padding-top: 20px;
}
#media (max-width: 767px) {
.card-4 .card-body {
padding: 50px 40px;
}
}
<!DOCTYPE html>
<html lang="es">
<head>
<!-- Required meta tags-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Title Page-->
<title>Alergias</title>
<!-- Icons font CSS-->
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
<!-- Font special for pages-->
<link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<!-- Vendor CSS-->
<!-- Main CSS-->
<link href="css/alergias.css" rel="stylesheet" media="all">
</head>
<body>
<div class="page-wrapper bg-gra-02 p-t-130 p-b-100 font-poppins">
<div class="wrapper wrapper--w680">
<div class="card card-4">
<div class="card-body">
<h2 class="title">Alergias</h2>
<h5 class="frase">Por favor, elige todas las alergias que tengas, para poder hacer los menus adaptados a ti:</h5>
<form method="POST">
<!---------------------------------------------------------------------->
<div class="container">
<ul class="ks-cboxtags">
<li><label ><input type="checkbox" name="Alergia1">Alergia 1</label></li>
<li><label ><input type="checkbox" name="Alergia2" >Alergia 1</label></li>
<li><input type="checkbox" id="checkboxThree" value="Alergia3" ><label for="checkboxThree">Alergia 1</label></li>
<li><input type="checkbox" id="checkboxFour" value="Alergia4"><label for="checkboxFour">Alergia 1</label></li>
<li><input type="checkbox" id="checkboxFive" value="Alergia5"><label for="checkboxFive">Alergia 1</label></li>
<li><input type="checkbox" id="checkboxSix" value="Alergia6" ><label for="checkboxSix">Alergia 1</label></li>
<li><input type="checkbox" id="checkboxSeven" value="Alergia7"><label for="checkboxSeven">Alergia 1</label></li>
<li><input type="checkbox" id="checkboxEight" value="Alergia8"><label for="checkboxEight">Alergia 1</label></li>
</ul>
</div>
<!---------------------------------------------------------------------->
<div class="p-t-15">
<button class="btn btn--radius-2 btn--blue" type="submit">Registrarse</button>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
So the first two checkboxes doesn't work.
Is there other way to do that? Thank you!
It doesn't seem to work for the first two "checkboxes" because putting the checkboxes in the label elements makes this CSS rule stop working:
ul.ks-cboxtags li input[type="checkbox"]:checked + label
That rule only applies to a checkbox followed by a label, not a label with a checkbox inside it.
If you're going to use the pattern with the checkbox inside the label, you're going to have to find a different way to do the styling. CSS isn't my strong suit, but as I understand it it's hard to style an element based on something inside that element. (There was once, briefly, a :contains pseudo-class, but it was never broadly supported because IIRC there were issues with performance.) This question's answers describe ways to do it, but unfortunately I think you're stuck with JavaScript if you do the containment.

Styling a button with hover effect

I'm having some issues with my code.
I added this button to my HTML page and CSS with the styling of the button class and the hover effect:
.buton4e {
background-color: #383f95;
border: none;
border-radius: 8px;
color: white;
padding: 7px 16px;
text-align: center;
text-decoration: none;
display: inline-block;
font-weight: bold;
cursor: pointer;
font-size: 16px;
}
.buton4e:hover {
background-color: #383f95;
border: none;
border-radius: 8px;
color: white;
padding: 7px 16px;
text-align: center;
text-decoration: none;
display: inline-block;
font-weight: bold;
font-size: 16px;
box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 40px 0 rgba(0, 0, 0, 0.19);
}
.intro-header {
padding-top: 40px;
padding-bottom: 40px;
text-align: center;
color: #f8f8f8;
background: url(../img/background.jpg) no-repeat center center;
background-size: cover;
}
.intro-message {
position: relative;
padding-top: 20%;
padding-bottom: 20%;
}
.intro-message>h1 {
margin: 0;
text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.6);
font-size: 5em;
}
.intro-divider {
width: 400px;
border-top: 1px solid #f8f8f8;
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
.intro-message>h3 {
text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.6);
}
<!-- Header -->
<header class="intro-header">
<div class="container">
<div class="intro-message">
<br /><br /><br />
<h3>90% of IT companies believe they need to partner to grow.<br /> Join <b>Channeliser</b> - the global network for building IT partnerships.</h3>
<hr class="intro-divider">
<button class="buton4e">JOIN FOR FREE</button>
</div>
</div>
</header>
The problem is that the effect works when I hover the button but there when the button is static it has no styling
*EDIT:
Sorry for not posting all the code.
This should be sufficient for the things I'm trying to modify.
Thanks in advance.
.styledButton {
font-family: Arial;
width: 100px;
height: 50px;
color: black;
background-color: grey;
border: 0;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.styledButton:hover {
color: white;
background-color: black;
}
.styledButton:active {
opacity: 0.5;
}
<button class = "styledButton">Click Me!</button>
This should help. Any click animations I have trouble with.

'Click' animation effect on button with CSS

I am not able to achieve the click-effect in my Next button (see snippet 1).
In the first snippet it is achievend with the float: left; value, but when I insert it into my code, it breaks the position of the button. My 'Next' button is supposed to be the way it is the second snippet, i.e. vertically and horizontally centered.
Any ideas how to find a workaround here?
Snippet 1
.next-button {
transition: all 0.1s;
-webkit-transition: all 0.1s;
position: relative;
padding: 10px 40px;
margin: 0px 10px 10px 0px;
float: left;
border-radius: 10px;
font-family: 'Montserrat';
font-size: 25px;
color: #ffffff;
text-decoration: none;
background-color: #f9c60f;
border-bottom: 5px solid #888888;
text-shadow: 1px -2px #888888;
}
.next-button:active {
transform: translate(0px,5px);
-webkit-transform: translate(0px,5px);
border-bottom: 1px solid;
}
<html lang="en">
<head>
<body>
NEXT
</body>
</html>
Snippet 2 (My code)
.next-button {
transition: all 0.1s;
-webkit-transition: all 0.1s;
position: relative;
padding: 10px 40px;
margin: 0px 10px 10px 0px;
float: left;
border-radius: 10px;
font-family: 'Montserrat';
font-size: 25px;
color: #ffffff;
text-decoration: none;
background-color: #f9c60f;
border-bottom: 5px solid #888888;
text-shadow: 1px -2px #888888;
}.course-video {
background: #f9c70f;
border: none;
margin: 0;
box-shadow: 0px 2px 4px rgba(0,0,0,0.3) inset;
-moz-box-shadow: 0px 2px 4px rgba(0,0,0,0.3) inset;
border-radius: 0;
-moz-border-radius: 0;
}
.next-video-button {
transition: all 0.1s;
-webkit-transition: all 0.1s;
padding:7px 200px;
border-radius: 10px;
font-family: 'Montserrat';
font-size: 1em;
color: #ffffff;
text-decoration: none;
background-color: #888888;
border-bottom: 5px solid #5a5a5a;
text-shadow: 1px -2px #888888;
text-align: center;
line-height:49px;
}
.next-video-button:active {
transform: translate(0px,5px);
-webkit-transform: translate(0px,5px);
border-bottom: 1px solid;
}
.video-title {
font-family: montserrat;
font-size: 1.5em;
color: #000000;
padding: 0.5em;
box-sizing: border-box;
width: 854px;
text-shadow: 0px 2px 4px rgba(0,0,0,0.3);
}
.video-descr {
width: 854px;
box-sizing: border-box;
height: 50px;
margin-top: -5px;
text-align:center;
}
.next-button:active {
transform: translate(0px,5px);
-webkit-transform: translate(0px,5px);
border-bottom: 1px solid;
}
<div class="course-video video-title">Hello</div>
<iframe src="https://player.vimeo.com/video/154094373" width="854" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<div class="course-video video-descr">NEXT</div>
Try using
.next-video-button {
display:inline-block;
...
}
instead of
float:left
Using inline-block makes the element act like it was text so your text-aligns will work on these as well

Aligning the html form to the center

The following html code gives a html form in a table but though i aligned the table to center it does not align to the center and remains in the left side of the web page!
<!DOCTYPE html>
<html>
<head>
<style>input.textfill {
float: right;
}</style>
<link type="text/css" rel="stylesheet" href="order.css" >
<script type="text/javascript">
var textbox = function(me){
if(me.checked == false){
var textb = document.createElement('textarea');
textb.name = "Address";
textb.id="Address";
textb.required=true;
textb.placeholder="Address";
me.parentNode.appendChild(textb);
}
setInterval(function(){
if(me.checked == false){
me.parentNode.removeChild(textb);
return false;
}
});
};
var i = 1;
function addkid() {
if (i <= 2) {
i++;
var div = document.createElement('div');
div.innerHTML ='<br><div class="headingbox">'+ 'Prescription Copy-'+i+':'+'</div>'+'<br><input id="uploadFile-' + i + '" class="disableInputField" placeholder="Choose File" disabled="disabled" />'+'<label class="fileUpload">'+'<input id="uploadBtn-' + i + '" type="file" required class="upload" name="Image'+i+'" />'+'<span class="uploadBtn-' + i + '">Upload</span>'+'</label>'+' <input id=remove type="button" value="-" onclick="removekid(this)">';
document.getElementById('kids').appendChild(div);
document.getElementById("uploadBtn-" + i).onchange = function() {
document.getElementById("uploadFile-"+i).value = this.value;
};
}
}
function removekid(div) {
document.getElementById('kids').removeChild(div.parentNode);
i--;
}
</script>
</head>
<body bgcolor="#E6E6FA">
<form id=orders name="orders" action="orders_action.php" method="post" enctype="multipart/form-data" onsubmit="return Validate(this);onTimeChange ();">
<table align="Center" >
<tr><td height="40"><br>
<div class="headingbox" id="hBoxNIC" > National ID </div>
<div style="width:100%;text-align:center;">
<input type="text" placeholder="920290505v" maxlength="13" name=NIC required autofocus />
</div>
</td></tr>
<tr><td height=50 ><div class="headingboxs">Pick up</div>
<input type=radio name=DP required value="Pickup">
<div style=" float: right;"><div class="headingboxs">
Delivery</div>
<input class="textfill" type=radio name=DP required value="Delivery" onmouseup="textbox(this)" /></div><br><br></td></tr>
<tr><td height="50"><div class="headingbox" >Expected Time </div>
<div style="width:100%;text-align:center;">
<input type="time" id=time autofocus name=DPTime onfocusout="hid('timeerror2');" onfocus="show('timeerror2');"min="09:00:00" max="22:00:00" /><br>
</div>
<div class="poperror" id="timeerror2"> Pharmacy is opened from 9AM to 10PM </div>
<script>
var input = document.getElementById('time');
function validateTime (element) {
var minTime = element.min;
var maxTime = element.max
var value = element.value + ':00'
if(minTime > value || value > maxTime) {
console.log("Time is outside of min/max.");
}
}
</script>
</td></tr>
<tr><td height="50"><div class="headingbox" id="hBoxPN"> Phone Number </div>
<div style="width:100%;text-align:center;">
<input type="text" maxlength=10; autofocus name=Tele /><br>
</div>
<div class="error" id="phoneerror" > error occured </div><br></td></tr>
<tr><td height="50"><div class="headingbox" id="hBoxEM"> E-mail </div>
<div style="width:100%;text-align:center;">
<input type="text" autofocus name=Email placeholder="xxx#gmail.com" /><br>
</div>
<div class="error" id="emailerror" > error occured </div><br>
</td></tr>
<tr>
<td height="50" width=330><br><div class="headingbox"> Prescription Copy-1</div> <div id="kids">
<input id="uploadFile" class="disableInputField" placeholder="Choose File" disabled="disabled" />
<label class="fileUpload">
<input id="uploadBtn" type="file" class="upload" name=Image1 />
<span class="uploadBtn">Upload</span>
</label>
<input type="button" id="add" onclick="addkid()" value="+" />
</div></td></tr>
<script>
document.getElementById("uploadBtn" ).onchange = function() {
document.getElementById("uploadFile").value = this.value;
};
</script>
</div></td></tr>
<tr><td colspan=5 align=center>
<input class="button" type=submit name=submit value=Place >
<input class="button" type=reset name=reset value=Cancel> </td></tr>
</table>
</form>
</body>
</body>
</html>
The css code is as follows
* { margin:0; padding:0;font-family: Arial; }
#orders {
padding: 0px 25px 25px;
background: #dcdcfb;
box-shadow:
0px 0px 0px 5px rgba( 255,255,255,0.4 ),
0px 4px 20px rgba( 0,0,0,0.33 );
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
display: table;
position:center;
width:60%;
margin: 20px;
}
#orders .inputs .buttonS {
width: 100%;
outline:none;
margin-top: 20px;
padding: 15px 0;
color: #fff;
font-size: 14px;
font-weight: 500;
letter-spacing: 1px;
text-align: center;
text-decoration: none;
background: -moz-linear-gradient(
top,
#b9c5dd 0%,
#a4b0cb);
background: -webkit-gradient(
linear, left top, left bottom,
from(#b9c5dd),
to(#a4b0cb));
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border: 1px solid #737b8d;
-moz-box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
-webkit-box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
text-shadow:
0px 1px 3px rgba(000,000,000,0.3),
0px 0px 0px rgba(255,255,255,0);
display: table;
position: static;
clear: both;
}
#orders .inputs .buttonS:hover {
background: -moz-linear-gradient(
top,
#a4b0cb 0%,
#b9c5dd);
background: -webkit-gradient(
linear, left top, left bottom,
from(#a4b0cb),
to(#b9c5dd));
}
#orders .inputs .buttonDis {
outline:none;
width: 100%;
margin-top: 20px;
padding: 15px 0;
color: #fff;
font-size: 14px;
font-weight: 500;
letter-spacing: 1px;
text-align: center;
text-decoration: none;
background: -moz-linear-gradient(
top,
#e0e0e0 0%,
#bfbfbf);
background: -webkit-gradient(
linear, left top, left bottom,
from(#e0e0e0),
to(#bfbfbf));
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border: 1px solid #737b8d;
-moz-box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
-webkit-box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
text-shadow:
0px 1px 3px rgba(000,000,000,0.3),
0px 0px 0px rgba(255,255,255,0);
display: table;
position: static;
clear: both;
}
#Address{
background: #f5f5f5;
font-size: 0.8rem;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border: none;
padding: 13px 10px;
width: 90%;
margin: auto;
margin-bottom: 17px;
box-shadow: inset 0px 2px 3px rgba( 0,0,0,0.1 );
-ms-box-sizing:content-box;
-moz-box-sizing:content-box;
box-sizing:content-box;
-webkit-box-sizing:content-box;
transition: all .5s ease-in-out;
}
.inputs select, input[type=date], input[type=text], input[type=password],input[type=time] {
background: #f5f5f5;
font-size: 0.8rem;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border: none;
padding: 13px 10px;
width: 90%;
margin: auto;
margin-bottom: 17px;
box-shadow: inset 0px 2px 3px rgba( 0,0,0,0.1 );
-ms-box-sizing:content-box;
-moz-box-sizing:content-box;
box-sizing:content-box;
-webkit-box-sizing:content-box;
transition: all .5s ease-in-out;
}
.inputs select:focus, input[type=date], input[type=text]:focus{
background: #fff;
box-shadow: 0px 0px 0px 3px #8efffc, inset 0px 2px 3px rgba( 0,0,0,0.2 ), 0px 5px 5px rgba( 0,0,0,0.15 );
outline: none;
}
.inputs ul li label{
display: block;
position: relative;
font-weight: 300;
font-size: 18px;
padding: 25px 25px 25px 80px;
margin: 10px auto;
height: 30px;
z-index: 9;
cursor: pointer;
-webkit-transition: all 0.25s linear;
}
.inputs ul li:hover label{
color: #FFFFFF;
}
.inputs ul li .check{
display: block;
position: absolute;
border: 5px solid #AAAAAA;
border-radius: 100%;
height: 25px;
width: 25px;
top: 30px;
left: 20px;
z-index: 5;
transition: border .25s linear;
-webkit-transition: border .25s linear;
}
.inputs input[type=radio]:checked ~ label{
color: #0DFF92;
}
.headingboxs{ /*for the radio button headings */
position:relative;
text-align:left;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 2px;
padding-top: 5px;
border-top-left-radius:2em;
border-top-right-radius:-2em;
border-bottom-right-radius:2em;
border-bottom-left-radius:-2em;
border-bottom-left-radius:-2em;
background: white;
left: 2%;
font-weight: bold;
display: inline-block;
box-shadow: inset 0px 2px 3px rgba( 0,0,0,0.1 );
transition: all .5s ease-in-out;
}
.headingbox{ /*for other headings */
position:relative;
text-align:left;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 2px;
padding-top: 5px;
border-top-left-radius:2em;
border-top-right-radius:0;
border-bottom-right-radius:2em;
border-bottom-left-radius:-2em;
border-bottom-left-radius:-2em;
background: white;
left: 4%;
font-weight: bold;
display: inline-block;
box-shadow: inset 0px 2px 3px rgba( 0,0,0,0.1 );
transition: all .5s ease-in-out;
}
.headbox{ /*for other headings */
position:relative;
text-align:left;
padding-left: 15px;
padding-right: 15px;
padding-bottom: 2px;
padding-top: 5px;
background: white;
left: 4%;
font-weight: bold;
display: inline-block;
box-shadow: inset 0px 2px 3px rgba( 0,0,0,0.1 );
transition: all .5s ease-in-out;
}
.poperror {
opacity:0;
visibility: visible;
width: 300px;
background-color: white;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 5;
!top: 100%;
!left: 100%;
margin-left: 10px;
margin-top: -15px;
-moz-box-shadow: 0 0 10px black;
-webkit-box-shadow: 0 0 10px black;
box-shadow: 0 0 10px black;
-webkit-transition: opacity 0.4s;
-moz-transition: opacity 0.4s;
-o-transition: opacity 0.4s;
transition: opacity 0.4s;
}
.poperror::after {
content: "";
position: absolute;
bottom: 100%;
left: 5%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: transparent transparent white transparent;
}
.error{
color:red;
font-size:10px;
text-align:left;
width: 350px;
margin-left:auto;
margin-right:auto;
margin-top:-12px;
margin-bottom:-10px;
font-style: italic;
-webkit-transition: opacity 0.4s;
-moz-transition: opacity 0.4s;
-o-transition: opacity 0.4s;
transition: opacity 0.4s;
opacity:0;
}
.column{
width:50%;
float:left;
}
*{
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
#remove{
width: 30px;
font-size: 20px;
background-color: gray;
color: white;
}
#add{
width: 30px;
font-size: 20px;
background-color: gray;
color: white;
}
.inputBtnSection{
display:inline-block;
vertical-align:top;
font-size:0;
font-family:verdana;
}
.disableInputField{
display:inline-block;
vertical-align:top;
height: 27px;
margin: 0;
font-size:14px;
padding:0 3px;
}
.fileUpload {
position: relative;
overflow: hidden;
display:inline-block;
vertical-align:top;
}
.fileUpload-2 {
position: relative;
overflow: hidden;
display:inline-block;
vertical-align:top;
}
.fileUpload-3 {
position: relative;
overflow: hidden;
display:inline-block;
vertical-align:top;
}
.uploadBtn{
display:inline-block;
vertical-align:top;
background:rgba(0,0,0,0.5);
font-size:14px;
padding:0 10px;
height:25px;
line-height:22px;
color:#fff;
border-radius: 5px;
}
.uploadBtn-2{
display:inline-block;
vertical-align:top;
background:rgba(0,0,0,0.5);
font-size:14px;
padding:0 10px;
height:25px;
line-height:22px;
color:#fff;
border-radius: 5px;
}
.uploadBtn-3{
display:inline-block;
vertical-align:top;
background:rgba(0,0,0,0.5);
font-size:14px;
padding:0 10px;
height:25px;
line-height:22px;
color:#fff;
border-radius: 5px;
}
.fileUpload input.upload {
position: absolute;
top: 0;
right: 0;
margin: 0;
padding: 0;
font-size: 20px;
cursor: pointer;
opacity: 0;
filter: alpha(opacity=0);
}
table {
align-self: center;
border: 2px solid CadetBlue;
border-radius: 5px;
}
#add_kid(){
width: 50px;
font-size: 10px;
}
.button:hover {
cursor:pointer;
background: -moz-linear-gradient(
top,
#a4b0cb 0%,
#b9c5dd);
background: -webkit-gradient(
linear, left top, left bottom,
from(#a4b0cb),
to(#b9c5dd));
}
.button{
margin-left:30px;
outline:none;
width: 20%;
margin-top: 20px;
padding: 15px 0;
color: #fff;
font-size: 14px;
font-weight: 500;
letter-spacing: 1px;
text-align: center;
text-decoration: none;
background: -moz-linear-gradient(
top,
#e0e0e0 0%,
#bfbfbf);
width: 150px;
background-color:grey;
border-radius: 5px;
height: 40px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border: 1px solid #737b8d;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background: -webkit-gradient(
linear, left top, left bottom,
from(#e0e0e0),
to(#bfbfbf));
-moz-box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
-webkit-box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
box-shadow:
0px 5px 5px rgba(000,000,000,0.1),
inset 0px 1px 0px rgba(255,255,255,0.5);
text-shadow:
0px 1px 3px rgba(000,000,000,0.3),
0px 0px 0px rgba(255,255,255,0);
}
#white-background{
display: none;
width: 100%;
height: 100%;
position: fixed;
top: 0px;
left: 0px;
background-color: #fefefe;
opacity: 0.7;
z-index: 9999;
}
#dlgbox{
/*initially dialog box is hidden*/
display: none;
position: fixed;
width: 480px;
z-index: 9999;
border-radius: 10px;
background-color: #7c7d7e;
}
#dlg-header{
background-color:aliceblue;
color: white;
font-size: 20px;
padding: 10px;
margin: 10px 10px 0px 10px;
}
#dlg-body{
background-color: white;
color: black;
font-size: 14px;
padding: 10px;
margin: 0px 10px 0px 10px;
}
#dlg-footer{
background-color: #f2f2f2;
text-align: right;
padding: 10px;
margin: 0px 10px 10px 10px;
}
#dlg-footer button{
background-color: grey;
color: white;
padding: 5px;
border: 0px;
}
please help to rectify this problem so that i can align the form to the center
form {
width: 980px;
margin: 0 auto;
}
Declare the width. So you can use the value AUTO in margin. margin: 0 auto do the trick

how does float left affect transform translate

If I remove the float:left attribute from .action-button the transform animation doesn't work. Can you explain what is happening here?
Markup:
Are
Styles:
.action-button
{
position: relative;
padding: 10px 40px;
margin: 0px 10px 10px 0px;
float: left;
border-radius: 8px;
font-family: 'Pacifico', cursive;
font-size: 25px;
color: #FFF;
text-decoration: none;
}
.green
{
background-color: #82BF56;
border-bottom: 5px solid #669644;
text-shadow: 0px -2px #669644;
}
.action-button:active
{
transform: translate(0px,5px);
-webkit-transform: translate(0px,5px);
border-bottom: 1px solid;
}
Codepen line 17: http://codepen.io/koriolis/pen/euAEg
This is because a elements are inline elements, in that they align the the parent element and do not clear either side.
When you add float: left, It changes the elements from being inline to block but also removes the clear: both and allows for elements to be aligned next to each other.
You can achieve the same effect as a float by using inline-block if you don't want the tags to float on the page.
.action-button {
position: relative;
padding: 10px 40px;
margin: 0px 10px 10px 0px;
display: inline-block;
border-radius: 8px;
font-family: 'Pacifico', cursive;
font-size: 25px;
color: #FFF;
text-decoration: none;
}
CodePen Example
tag a - default display: inline
float: left - display property is set to block
when you remove float: left - a again display: inline
use display: inline-block instead float: left
body {
padding: 50px;
}
.animate {
transition: all 0.1s;
-webkit-transition: all 0.1s;
}
.action-button {
position: relative;
padding: 10px 40px;
margin: 0px 10px 10px 0px;
display: inline-block;
border-radius: 8px;
font-family:'Pacifico', cursive;
font-size: 25px;
color: #FFF;
text-decoration: none;
}
.blue {
background-color: #3498DB;
border-bottom: 5px solid #2980B9;
text-shadow: 0px -2px #2980B9;
}
.red {
background-color: #E74C3C;
border-bottom: 5px solid #BD3E31;
text-shadow: 0px -2px #BD3E31;
}
.green {
background-color: #82BF56;
border-bottom: 5px solid #669644;
text-shadow: 0px -2px #669644;
}
.yellow {
background-color: #F2CF66;
border-bottom: 5px solid #D1B358;
text-shadow: 0px -2px #D1B358;
}
.action-button:active {
transform: translate(0px, 5px);
-webkit-transform: translate(0px, 5px);
border-bottom: 1px solid;
}
Hello
How
Are
You?
fiddle