how to display content horizontally in a hidden div? [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have hidden div and there is some content when div is been displayed the content should displayed in horizontally not vertically ?
the div will be displayed when i click on button.
<div class = "firstHidden">
<h4> Account No </h4>
<h5> 123456789 </h5>
<h4> Service Address </h4>
<h5> 49, Rampasture Raod, Hampton</h5>
<h4> Amount Due </h4>
<h5> payment Date : 09/12/2015 </h5>
</div>

try this css
.firstHidden h4, .firstHidden h5{
float:left;
padding-right:10px;
}

Try the following in your CSS: Adjust the div's width to your requirement.
div {
border: 1px solid black;
width: 70px;
overflow: hidden;
white-space: nowrap;
}

You can use this css class
.toCenterHorizontally{
margin: auto;
width: 60%;
border: 3px solid #73AD21;
padding: 10px;
}

Related

How can i create a white box like the example in CSS? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I was trying to create a white box like the example, that shows information when i click on a button (Web Development, Software engineering, System Administration).
I would like to have a tip for this with CSS, also, do i need a JavaScript for that?
Example
like this?
.box{
margin:40px;
position: relative;
box-shadow: 0 0 30px rgba(0,0,0,0.4);
padding: 30px;
}
.box:before{
content: "";
position:absolute;
top: -30px;
left: 50px;
border: 15px solid transparent;
border-bottom-color: white;
}
<div class="box">
Some content about development
</div>
I think:
.container p {
text-align: center;
vertical-align: center;
color: #fff;
font-family: sans-serif;
border-radius: 10px;
background-color: #FF2000;
width: 200px;
height: 110px;
padding-top: 90px;
}
<div class="container">
<p>Your Text</p>
</div>
Hope this is helpful. Details can be edited on .css.
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<body>
<div class="w3-container">
<h2>W3.CSS Modal</h2>
<button onclick="document.getElementById('id01').style.display='block'" class="w3-button w3-black">Open Modal</button>
<div id="id01" class="w3-modal">
<div class="w3-modal-content">
<div class="w3-container">
<span onclick="document.getElementById('id01').style.display='none'" class="w3-button w3-display-topright">×</span>
<p>Some text. Some text. Some text.</p>
<p>Some text. Some text. Some text.</p>
</div>
</div>
</div>
</div>
</body>
</html>
Link to test here

want to fix contact form till we are in that particular section [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
enter image description here
Want to fix right side form till we are in that particular section (Course Curriculum).
any kind of help will be appreciated.
you can use the help of CSS sticky property
<div class="form-container">
<div>other content</div>
<div class="form">form</div>
</div>
<div class="other-container">
</div>
<style>
.form-container{
height: 150vh;
background: #f1f1f1;
position: relative;
display: flex;
justify-content: space-between;
}
.form{
background: pink;
width: 30vw;
position: -webkit-sticky;
position: sticky;
right: 0;
top: 10vh;
height: 50vh;
}
.other-container{
height: 150vh;
}
</style>

How do I align a button center of the web page? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I want to align this button centre of the web page; any ideas how to do that?
<button id="user-button" class="Sign-in"> Sign in </button>
<style>
.Sign-in{
background-color: springgreen;
border: none;
color: white;
padding: 15px 25px;
text-align: center;
font-size: 18px;
cursor: pointer;
border-radius: 10px;
font-family: Lobster, helvetica;
}
</style>
Try wrapping the button in a div and giving that div a text-align property of center.
CSS:
#button-container {
text-align: center;
}
<div id="button-container">
<button>Center Me</button>
</div>

How to get one div inside another? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I am trying to put my second div box inside my first div box how would i implement that ..
<style>
div {
width: 400px;
height:50px;
padding: 25px;
margin: 25px;
border-style: solid;
border-width: 1px;
}
#knob {
width: 50px;
height:50px;
background-color: grey;
}
</style>
</head>
<body>
<h1>Grade me in chrome</h1>
<form action="">
<input type="radio" name="angle" value="Horizontal" checked>Horizontal
<input type="radio" name="angle" value="Vertical">Vertical
my second div would need to take up 25% of my first div how shall i do that or do i need to implement it another way?
Ideally you shouldn't be styling the div like this.
Add a class and style based on the class.
.outer-div{
width: 400px;
height:50px;
padding: 25px;
margin: 25px;
border-style: solid;
border-width: 1px;
}
.inner-div{
width: 25%;
height: auto;
padding: 25px;
border-style: solid;
border-width: 1px;
}
<div class="outer-div">
<div class="inner-div"></div>
http://jsbin.com/yaqovokuce/edit
I have updated your jsfiddle here
http://jsfiddle.net/qe81taap/
Element selector should be only used if the style needs to be reflected across all the element, otherwise use class or id selector

How to center navbar content after menu collapse? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am working on a website which needs to have two headers. The second header holds the social icons (facebook, twitter, linkedin, google plus) and next to them I have this heading:"Fast Social Login>>" .
Initially, with the css, I pulled them to the right. I am using the 'collapse' and 'navbar-collapse' classes for the heading because I don't want it to be shown on smaller screens. However, when this heading collapses, I want the social icons to be centered on the navbar.
Can this be solved with CSS adjustment or do I need to write scripts?
HTML:
<div class="navbar navbar-inverse navbar-static-top header-bottom-border">
<div class="container">
<img src="img/googleplus.png" class="social-position pull-right">
<img src="img/linkedin.png" class="social-position pull-right">
<img src="img/twitter.png" class="social-position pull-right">
<img src="img/facebook.png" class="social-position pull-right">
<div class="collapse navbar-collapse">
<h2 class=" navbar-text pull-right" style="color: #b0b0b0">FAST SOCIAL LOGIN>></h2>
</div>
</div>
</div>
CSS:
.header-bottom-border{
border-width: 0 0 5px 0;
border-color: #4c9322;
}
.social-position{
width: 3em;
height: 3em;
display:inline-block;
margin-left: 10px;
margin-top: 10px;
vertical-align: middle;
}
Have you tried using text-align: center with media query?
See the exact width when your navbar-collapse collapses, and write a query for that width.
#media (max-width: width-when-navbar-collapses) {
.container {
text-align: center;
a {
float: none;
}
}
}
Try this:
#media (max-width: width-when-navbar-collapses) {
.container a{
display: block;
width: 100%;
}
.container a img {
display: table;
margin: 0 auto;
}
}
Yes, this is possible by only using CSS, more specific, by using media-queries
Looking at the Bootstrap-source for the navbar, they use a media-query with a specific variable to change the behaviour of the navbar depending on the device-width:
#media (min-width: #grid-float-breakpoint)
Using a mobile-first approach, what you would need to do is set the social icons to be centered per default and override this using this media - query that targets the minimum width and above.
This could be achieved with something like in this example:
.navbar .container {
text-align: center;
.pull-right {
// you probably need to override these in here
float: none;
}
#media (min-width: #grid-float-breakpoint){
text-align: start ;
.pull-right {
float: right;
}
}
}
In case you're not using LESS (or any other preprocessor) and you have the compiled version of bootstrap in your project, the default-value of #grid-float-breakpoint is 768px, as defined here in the source

Categories