I want to style the font/text to bold to text inside the
col-md-6 label-wrapper
I tried some css styling but does not affect the current font of my webpage when printing
.col-md-6{
display: relative;
}
.col-md-6 label-wrapper{
font-weight: bold;
}
Also I want to display it horizontaly in print, something like
purchase order: 34567
name: abcd
street: ca
qty: ty
Currently, when I print the selected html content using Javascript print function, the output looks like this
purchase order:
34567
name:
abcd
qty:
67
My content
<div class="col-md-4 order-column prod-wrapper">
<h3 class="vo-title"> Order Details </h3>
<div class="prod-row vo-content">
<div class="col-md-6 label-wrapper"> Purchase Order #: </div>
<div class="col-md-6 "> <?php echo $order[0]['po_number']; ?></div>
</div>
</div>
HTML:
<div class="col-md-4 order-column prod-wrapper">
<h3 class="vo-title"> Order Details </h3>
<div class="prod-row vo-content">
<div class="col-md-6 label-wrapper"> Purchase Order #: </div>
<div class="col-md-6 result ">3567</div>
</div>
</div>
CSS :
.col-md-6{
display: relative;
}
.label-wrapper{
font-weight: bold !important;
}
.col-md-6 {
display: inline;
}
Demo Link
Try font-weight:bold !important; or font-weight:600;
If that doesn't work, font-weight: 600 !important;
!important overrides the previous statement.
OR, if that doesn't work, play around with the .bold() function, or place the output between <b></b> or <strong></strong> tags.
On you CSS you have:
.col-md-6 label-wrapper{
font-weight: bold;
}
You forgot to set .(dot) on labe-wrapper (it's a class)
.col-md-6 .label-wrapper{
font-weight: bold;
}
To display both lines in the same line use on col-md-6
display: inline;
I'll guess You need for the font problem to use
.label-wrapper
{
font-weight: 600+ (<900) (!important if the style sheet is override by bootstrap)
}
And to get your element in one line you can use white-space: nowrap
try this,
.my-data {
font-weight:bold !important;}
<div class"col-md-6 my-data">Purchase Order#:
<span><?php echo echo $order[0]['po_number']; ?></span>
</div>
Related
I want to wrap long texts beside labels (in this context b tags being used as labels. please look at below code to understand better) such a way that the next line starts just below the first word of the long text.
NOTE: I'm using CSS framework Bootstrap.
.patient-details {
display: inline-block;
text-align: left;
width: 130px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<div class="row">
<div class="col">
<p><b class="patient-details">Patient Name </b>: <i>A Looooooonnnnnngggggg Naaaammmee</i></p>
<p><b class="patient-details">C/o-(Brought By) </b>: P S S Raj</p>
<p><b class="patient-details">Contact Number </b>: 90********</p>
</div>
<div class="col">
<p><b class="patient-details">Patient ID </b>: 1</p>
<p><b class="patient-details">Patient Gender </b>: Male</p>
<p><b class="patient-details">Patient Age </b>: 18 Yrs</p>
</div>
</div>
<br>
<div class="row">
<p><b class="patient-details">Address </b>: <i>A Verrrrryyyyyyy Loooooooonnnnnggggggg Addddddddddddddrrrrrrrrreeeeeeeeeesssssssssssssss</i></p>
</div>
I tried aligning patient details beside labels(namely the b tags)
When in print preview mode(ctrl + p) the expected output is given below:
Patient Name : A Looooooonnnnnngggggg Patient ID : 1
Naaaammmee
C/o-(Brought By) : P S S Raj Patient Gender: Male
Contact Number : 90******** Patient Age : 18Yrs
Patient Address : A Verrrrryyyyyyy Loooooooonnnnnggggggg
Addddddddddddddrrrrrrrrreeeeeeeeeesssssssssssssss
But the output in print preview mode(ctrl + p) I got is a bit different, like given below:
Patient Name : A Looooooonnnnnngggggg Patient ID : 1
Naaaammmee
C/o-(Brought By): P S S Raj Patient Gender: Male
Contact Number : 90******** Patient Age : 18Yrs
Patient Address : A Verrrrryyyyyyy Loooooooonnnnnggggggg
Addddddddddddddrrrrrrrrreeeeeeeeeesssssssssssssss
Like shown above I want the long texts beside the "Patient Name" and "Patient Address" to wrap and start a new line from just below the first word of the long text.
I tried adding some inline CSS to the i tag, like position: absolute but it just isn't working. Any Ideas?
Is there a way to wrap a long phrase beside an 'inline-block' styled tag?
It is possible but not with the current solution.
Example of current solution: <p><b class="patient-details">Contact Number </b>: 90********</p>
Your desired effect is impossible if you wrap your label (<b>) with a paragraph (<p>). This is because the <p> tag, and many other physical objects, are displayed in a special container known as "content". (check out CSS Box Model).
Any long phrase on collapse will start a new line in the content. Usually, by default, a new line starts horizontally from left-to-right. (Unless specified for a specific language such as Arabic).
Do you see the problem :) ? The label is inside that content, and there is nothing we can do to escape it. But there are alternative ways to re-create your desired text wrapper.
Some notable solutions: Use CSS Grid Layout Module, CSS Flexbox, and classic use of HTML Tables
(Credits: David Thomas, Pete and Johannes),
The key is to separate the label from the paragraph in order to define new physical content. This way, your paragraph will not interfere with the label as long as the label's container occupies the available space.
Here is my solution (Not the greatest, but it does the work)
* {
margin: 0;
padding: 0;
}
:root {
--data-span-width: 20px;
--data-title-width: 130px;
--data-p-width: 1fr;
--data-p-min-width: 100px;
--data-aside-p-width: 100px;
}
.box {
width: 75vw;
min-width: 575px;
border: 1px solid #000;
}
/* Data row */
.box .data {
display: grid;
grid-template-columns:
var(--data-title-width)
var(--data-span-width)
var(--data-p-width);
}
.box .data > label {
font-weight: bold;
}
.box .data > p:last-child {
word-break: break-all;
min-width: var(--data-p-min-width);
}
/* Data with another Data, but on the right side */
.box > .aside {
display: flex;
justify-content: space-between;
}
.box > .aside > .data:last-child {
margin-left: 50px;
}
.box > .aside > .data:last-child p:last-child {
width: var(--data-aside-p-width);
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
</head>
<body>
<div class="box">
<div class="aside">
<div class="data">
<label>Patient Name</label><span>:</span>
<p>A Looooooonnnnnngggggg Naaaammmee</p>
</div>
<div class="data">
<label>Patient ID</label><span>:</span>
<p>1</p>
</div>
</div>
<div class="aside">
<div class="data">
<label>C/o-(Brought By)</label><span>:</span>
<p>P S S Raj</p>
</div>
<div class="data">
<label>Patient Gender</label><span>:</span>
<p>Male</p>
</div>
</div>
<div class="aside">
<div class="data">
<label>Patient Age</label><span>:</span>
<p>18 Yrs</p>
</div>
<div class="data">
<label>Contact Number</label><span>:</span>
<p>+923 999 9999 999</p>
</div>
</div>
<div class="data">
<label>Patient Address</label><span>:</span>
<p>A Verrrrryyyyyyy Loooooooonnnnnggggggg Addddddddddddddrrrrrrrrreeeeeeeeeesssssssssssssss</p>
</div>
</div>
</body>
</html>
In one of my page I can have two situation.
The first, in case no event found
<div class="mec-wrap mec-skin-list-container" id="mec_skin_1210">
<div class="mec-skin-list-events-container" id="mec_skin_events_1210">
No event found! </div>
</div>
or this if at least event is found
<div class="mec-wrap mec-skin-list-container" id="mec_skin_1210">
<div class="mec-skin-list-events-container" id="mec_skin_events_1210">
<div class="mec-wrap colorskin-custom">
<div class="mec-event-list-minimal">
<article data-style="" class="mec-event-article mec-clear mec-divider-toggle mec-toggle-202003-1210" itemscope="">
ARTICLE HERE
</article>
</div>
</div>
<div class="mec-skin-list-no-events-container" id="mec_skin_events_1210">
Nessun evento trovato! </div>
</div>
I need to hidden the first situation, I don't see the "No events found"
I have found a solution with css.
This work fine, but if I use display instead visibility, the code not work.
Work fine the "display:none" but I can't make it reappear the structure if event is found.
I have tried every value for "display" (block, flex, etc. etc.) nobody works
https://codepen.io/MarcoRM69/pen/VwLrXWb
.mec-skin-list-events-container {
visibility:hidden;
}
.mec-skin-list-events-container > div {
visibility:visible;
}
Any suggestions?
Modern browsers doesn't yet have impletemted has() pseudo-class unfortunately.
You can that easily with a JavaScript or library such as jQuery instead of using CSS. jQuery implement :has() selector.
Description: Selects elements which contain at least one element that matches the specified selector.
The expression $( "div:has(p)" ) matches a <div> if a <p> exists anywhere among its descendants, not just as a direct child.
$('.mec-skin-list-events-container').addClass("d-none");
$('.mec-skin-list-events-container:has(div)').addClass("d-block");
body {
color: green;
font-size: 1.25em;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.mec-skin-list-events-container+div:not(:has(div)) {
color: black;
}
.d-none {
display: none;
}
.d-block {
display: block;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="mec-wrap mec-skin-list-container" id="mec_skin_1210">
<div class="mec-skin-list-events-container" id="mec_skin_events_1210">
Nessun evento trovato! </div>
</div>
<hr>
<div class="mec-wrap mec-skin-list-container" id="mec_skin_1210">
<div class="mec-skin-list-events-container" id="mec_skin_events_1210">
<div class="mec-wrap colorskin-custom">
<div class="mec-event-list-minimal">
<article data-style="" class="mec-event-article mec-clear mec-divider-toggle mec-toggle-202003-1210" itemscope="">
ARTICLE HERE
</article>
</div>
</div>
<div class="mec-skin-list-no-events-container" id="mec_skin_events_1210">
Nessun evento trovato! </div>
</div>
</div>
display: none... is not working, while visibility:hidden... is working because display: none removes the affected element from the page while visibility:hidden does not.
Since display:none removes the containing div, you cannot then ask to display the contained div.
From your codepen:
.mec-skin-list-events-container {
visibility:hidden;
/*display:none;*/
}
.mec-skin-list-events-container > div {
visibility:visible;
/*display:block;*/
}
This website shows some text which is strike through. Its nowhere mentioned in the CSS or html as far as I could look. Here is the code for it,
<div style="width:100%;height:259px;background-image: url('<?php echo get_template_directory_uri(); ?>/images/child.png'); color: #f3ffcd;">
<div class="container">
<div class="row health_text">
394,000 Children die in Pakistan before their fifth birthdays due to poor access to healthcare facilities.
</div>
</div>
</div>
CSS:
font-size: 36px;
margin: 85px 0;
font-family: 'Maven Pro', sans-serif;
It seems it is the s tag which is doing that :
It has property : text-decoration: line-through;
You could use the <del></del> tags, this should be what you're looking for.
I am trying to get a similar look like Reddit or HackerNews voting where up/down arrows are get stacked. What I tried rather gives me following look:
My Code is given below:
HTML
<ul class="list-unstyled">
<li class="entry">
<div class="row">
<div class="col-sm-2 entry__rank">
<span class="pull-left">1.</span>
<i class="fa fa-icon fa-caret-up fa-2x pull-left"></i>
<i class="fa fa-icon fa-caret-down fa-2x pull-left"></i>
</div>
<div class="col-md-9">
<span class="entry__title">
This is a great billboard
</span>
</div>
</div>
</li>
</ul>
CSS
.entry {
padding: 5px;
margin-bottom: 20px;
}
.entry__rank {
font-size: 20px;
font-weight: bold;
color: grey;
padding: 5px 0 5px 0;
margin-top: -10px !important;
}
.entry__title {
font-weight: bold;
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 16px;
}
.entry__title a {
color: #285ddf !important;
}
Desired Look
Event something like Stackover flow voting would work.
Edited to provide a better plugin:
Using the following will probably be a better and less bloated solution:
https://github.com/janosgyerik/upvotejs
Reddit actually has their code available for people to take and basically create their own Reddit clone if they wanted:
https://github.com/reddit/reddit
Look through this and you'll probably find exactly what you're looking for.
U can use html button and any javascript variable to display the count.
In the button tag add onclick property and call a JavaScript method which increases the variable value on click of button
Similar approach for down count just decrease the value in the method
https://codeshare.io/Xv5xB
Use bootstrap lib [http://getbootstrap.com/] which has more features & follow this code.
<div className = "row">
<div className = "u-full-width u-cf link-item">
<div className = "u-pull-left link-vote">
<div className = "u-pull-left vote-buttons">
<div className = "arrow-up upvote" onClick={this._onVoteUp}></div>
<div className = "arrow-down downvote" onClick= {this._onVoteDown}></div>
</div>
<span className="points">{this.state.points}</span>
</div>
<div className="u-pull-right link-content" onClick={this._onLineClick}>
{this.props.title}
<span className="u-pull-right info">{domain}</span>
</div>
</div>
</div>
Write method for UpVote , DownVote & etc.
I have attached screenshot of bootstrap panel(repeated). the second text paragraph (Taj) displays in next line and hence the chevron style (padding-top:50%) doesn't align to exact middle(or center) of the panel.How do I resolve this issue?
Also, I need to chnage the color of the body text and chevron to blue on mouseover.
How can I achieve this?
.chevronAtRight{
font-size:20px;
padding-top:80%;
}
.hoverChevronFont{
color:#49B4E8;
font-family: 'Avenir', 'Helvetica', 'Arial';
font-style: 'Book';
}
<p class="panelTextFont14 panelText" ng-attr-title="{{reservation.resortName}}">
{{reservation.resortName}}
</p>
...
<div class="col-xs-1 col-sm-1 col-md-1">
<p><i class="glyphicon glyphicon-chevron-right pull-right chevronAtRight"></i>
</p>
</div>
...
To change the color of the chevron :
.glyphicon:hover {
color:#49B4E8;
}
But for change the color of all body text you need to use jquery onmouseover.
And for center the chevron try something like this :
.vcenter {
display: inline-block;
vertical-align: middle;
float: none;
}
And in your html :
<div class="col-xs-1 col-sm-1 col-md-1 vcenter">