I'm trying to align the image below the Benefits paragraph but for some reason it won't allow me to position it there. I used background-position: % %; When I change it to be more lower than the paragraph, my image hides and when I give the section more height, The image isn't showing aswell.
I am only allowed to use CSS (so need to work with css background properties, and not HTML for this project.
/*derde section*/
.participation h3 {
font-family: fraktur;
font-weight: 100;
font-size: 10em;
width: 50%;
color: #4A4A4A;
text-align: left;
}
.participation {
/* width: 80%; */
display: grid;
grid-template-columns: 1fr;
margin: 50px auto;
/* border: 2px solid #000000; */
background-image: url('../images/peace.png');
background-repeat: no-repeat;
background-size: contain;
background-position: 13% 82%;
justify-items: end;
}
.participation p {
width: 47%;
margin: 15px 40px;
}
.benefits h3 {
font-family: baskerville;
font-weight: 100;
font-size: 10em;
width: 50%;
color: #000000;
text-align: left;
}
.benefits {
/* width: 80%; */
display: grid;
grid-template-columns: 1fr;
margin: 50px auto;
background-image: url('http://thomasdebelder.be/zengarden%20website//images/kop2.png');
background-repeat: no-repeat;
background-size: contain;
background-position: right bottom;
justify-items: end;
}
.benefits p {
width: 47%;
margin: 15px 40px;
}
/*einde derde section*/
<div class="participation" id="zen-participation" role="article">
<h3>Participation</h3>
<p>Strong visual design has always been our focus. You are modifying this page, so strong <abbr title="Cascading Style Sheets">CSS</abbr> skills are necessary too, but the example files are commented well enough that even <abbr title="Cascading Style Sheets">CSS</abbr> novices can use them as starting points. Please see the <abbr title="Cascading Style Sheets">CSS</abbr> Resource Guide for advanced tutorials and tips on working with <abbr title="Cascading Style Sheets">CSS</abbr>.</p>
<p>You may modify the style sheet in any way you wish, but not the <abbr title="HyperText Markup Language">HTML</abbr>. This may seem daunting at first if you’ve never worked this way before, but follow the listed links to learn more, and use the sample files as a guide.</p>
<p>Download the sample HTML and CSS to work on a copy locally. Once you have completed your masterpiece (and please, don’t submit half-finished work) upload your <abbr title="Cascading Style Sheets">CSS</abbr> file to a web server under your control. Send us a link to an archive of that file and all associated assets, and if we choose to use it we will download it and place it on our server.</p>
</div>
<div class="benefits" id="zen-benefits" role="article">
<h3>Benefits</h3>
<p>Why participate? For recognition, inspiration, and a resource we can all refer to showing people how amazing <abbr title="Cascading Style Sheets">CSS</abbr> really can be. This site serves as equal parts inspiration for those working on the web today, learning tool for those who will be tomorrow, and gallery of future techniques we can all look forward to.</p>
</div>
You can add a big padding to the section at the bottom and adjust the background like this :
/*derde section*/
.participation h3 {
font-family: fraktur;
font-weight: 100;
font-size: 10em;
width: 50%;
color: #4A4A4A;
text-align: left;
}
.participation {
/* width: 80%; */
display: grid;
grid-template-columns: 1fr;
margin: 50px auto;
/* border: 2px solid #000000; */
background-image: url('../images/peace.png');
background-repeat: no-repeat;
background-size: contain;
background-position: 13% 82%;
justify-items: end;
}
.participation p {
width: 47%;
margin: 15px 40px;
}
.benefits h3 {
font-family: baskerville;
font-weight: 100;
font-size: 10em;
width: 50%;
color: #000000;
text-align: left;
}
.benefits {
/* width: 80%; */
display: grid;
grid-template-columns: 1fr;
margin: 50px auto;
background-image: url('http://thomasdebelder.be/zengarden%20website//images/kop2.png');
background-repeat: no-repeat;
background-position: 73% 100%;
justify-items: end;
padding-bottom: 400px;
}
.benefits p {
width: 47%;
margin: 15px 40px;
}
/*einde derde section*/
<div class="participation" id="zen-participation" role="article">
<h3>Participation</h3>
<p>Strong visual design has always been our focus. You are modifying this page, so strong <abbr title="Cascading Style Sheets">CSS</abbr> skills are necessary too, but the example files are commented well enough that even <abbr title="Cascading Style Sheets">CSS</abbr> novices can use them as starting points. Please see the <abbr title="Cascading Style Sheets">CSS</abbr> Resource Guide for advanced tutorials and tips on working with <abbr title="Cascading Style Sheets">CSS</abbr>.</p>
<p>You may modify the style sheet in any way you wish, but not the <abbr title="HyperText Markup Language">HTML</abbr>. This may seem daunting at first if you’ve never worked this way before, but follow the listed links to learn more, and use the sample files as a guide.</p>
<p>Download the sample HTML and CSS to work on a copy locally. Once you have completed your masterpiece (and please, don’t submit half-finished work) upload your <abbr title="Cascading Style Sheets">CSS</abbr> file to a web server under your control. Send us a link to an archive of that file and all associated assets, and if we choose to use it we will download it and place it on our server.</p>
</div>
<div class="benefits" id="zen-benefits" role="article">
<h3>Benefits</h3>
<p>Why participate? For recognition, inspiration, and a resource we can all refer to showing people how amazing <abbr title="Cascading Style Sheets">CSS</abbr> really can be. This site serves as equal parts inspiration for those working on the web today, learning tool for those who will be tomorrow, and gallery of future techniques we can all look forward to.</p>
</div>
One option would be add a padding-bottom to the h3 element to give room for the background image. Like this:
/*derde section*/
.participation h3 {
font-family: fraktur;
font-weight: 100;
font-size: 10em;
width: 50%;
color: #4A4A4A;
text-align: left;
}
.participation {
/* width: 80%; */
display: grid;
grid-template-columns: 1fr;
margin: 50px auto;
/* border: 2px solid #000000; */
background-image: url('../images/peace.png');
background-repeat: no-repeat;
background-size: contain;
background-position: 13% 82%;
justify-items: end;
}
.participation p {
width: 47%;
margin: 15px 40px;
}
.benefits h3 {
font-family: baskerville;
font-weight: 100;
font-size: 10em;
width: 50%;
color: #000000;
text-align: left;
padding-bottom: 100%;
}
.benefits {
/* width: 80%; */
display: grid;
grid-template-columns: 1fr;
margin: 50px auto;
background-image: url('http://thomasdebelder.be/zengarden%20website//images/kop2.png');
background-repeat: no-repeat;
background-size: contain;
background-position: right 60%;
justify-items: end;
}
.benefits p {
width: 47%;
margin: 15px 40px;
}
/*einde derde section*/
<div class="participation" id="zen-participation" role="article">
<h3>Participation</h3>
<p>Strong visual design has always been our focus. You are modifying this page, so strong <abbr title="Cascading Style Sheets">CSS</abbr> skills are necessary too, but the example files are commented well enough that even <abbr title="Cascading Style Sheets">CSS</abbr> novices can use them as starting points. Please see the <abbr title="Cascading Style Sheets">CSS</abbr> Resource Guide for advanced tutorials and tips on working with <abbr title="Cascading Style Sheets">CSS</abbr>.</p>
<p>You may modify the style sheet in any way you wish, but not the <abbr title="HyperText Markup Language">HTML</abbr>. This may seem daunting at first if you’ve never worked this way before, but follow the listed links to learn more, and use the sample files as a guide.</p>
<p>Download the sample HTML and CSS to work on a copy locally. Once you have completed your masterpiece (and please, don’t submit half-finished work) upload your <abbr title="Cascading Style Sheets">CSS</abbr> file to a web server under your control. Send us a link to an archive of that file and all associated assets, and if we choose to use it we will download it and place it on our server.</p>
</div>
<div class="benefits" id="zen-benefits" role="article">
<h3>Benefits</h3>
<p>Why participate? For recognition, inspiration, and a resource we can all refer to showing people how amazing <abbr title="Cascading Style Sheets">CSS</abbr> really can be. This site serves as equal parts inspiration for those working on the web today, learning tool for those who will be tomorrow, and gallery of future techniques we can all look forward to.</p>
</div>
Related
I wanted to know why my image isn't showing up in the Buildfire platform when i place the code into the source area.....I've tested it on everything else and it works perfectly...dreamweaver and everything.... Need help to help get the image to show up in buildfire. The code i am using is below:
<p class="bf-wysiwyg-hide-app bf-wysiwyg-top"><img src="blob:https://pluginserver.buildfire.com/890db794-346d-4428-be1f-aa8dd5f5efdc" style="display: none;" onload="typeof buildfire !== 'undefined' && buildfire.dynamicBlocks.execute(this);" data-type="dynamic-expression" /></p>
<div id="bf_mce_layout_2" class="bf-wysiwyg-top bf-wysiwyg-hide-app" data-bf-layout="%7B%22id%22%3A%22bf_mce_layout_2%22%2C%22cssUrl%22%3A%22layouts/bf_mce_layout2.css%22%2C%22htmlUrl%22%3A%22layouts/template_a.html%22%7D" data-layout-name="bf_mce_layout_2"><!-- This template should not be changed once is live -->
<div class="bf_mce_img-container"><img src="https://dallasexaminer.com/wp-content/uploads/2023/01/Preparing-for-Legislative-Session.jpg" onclick="buildfire.actionItems.execute(JSON.parse(unescape(this.getAttribute("data-execute"))), ()=>{})" data-bf-image="%7B%22originalSrc%22%3A%22https%3A//s3-us-west-2.amazonaws.com/imageserver.prod/71e97b33-4374-11ec-9fe6-12a56cc33887/karen-bass.jpg%22%7D" data-execute="%7B%22action%22%3A%22linkToApp%22%2C%22instanceId%22%3A%22665ce2b8-7ce6-4cb5-bbfc-282dc22cdd6c-1651251310477%22%2C%22title%22%3A%22Current%20News%22%2C%22iconUrl%22%3A%22https%3A//pluginserver.buildfire.com/plugins/60/resources/icon.png%22%2C%22queryString%22%3Anull%2C%22deeplinkId%22%3Anull%7D" /></div>
<div class="bf_mce_copy">
<h1>Current News</h1>
<p class="bf_mce_caption">Check out the current news from The Dallas Examiner today by clicking the button below</p>
</div>
<button class="bf-btn bf-btn-primary" onclick="buildfire.actionItems.execute(JSON.parse(unescape(this.getAttribute('data-execute'))), ()=>{})" data-execute="%7B%22title%22%3A%22Current%20News%22%2C%22iconUrl%22%3A%22https%3A//pluginserver.buildfire.com/plugins/60/resources/icon.png%22%2C%22action%22%3A%22linkToApp%22%2C%22instanceId%22%3A%22665ce2b8-7ce6-4cb5-bbfc-282dc22cdd6c-1651251310477%22%2C%22queryString%22%3Anull%2C%22deeplinkId%22%3Anull%7D">Current News</button></div>
<p class="bf-wysiwyg-top bf-wysiwyg-hide-app"> </p>
<style class="bf-wysiwyg-top bf-wysiwyg-hide-app" data-layout-name="bf_mce_layout_2">
#bf_mce_layout_2 * > span{
color: currentColor;
}
#bf_mce_layout_2{
font-size: 16px;
margin: 1rem;
border-radius: 1rem;
overflow: hidden;
position: relative;
text-align: center;
box-shadow: 0 .5rem 1rem rgba(77, 77, 77, 0.5);
}
#bf_mce_layout_2 .bf_mce_img-container{
position: relative;
left: 0;
top: 0;
height: 200px;
width: 100%;
}
#bf_mce_layout_2 .bf_mce_img-container img{
width: 100%;
height: 100%;
object-fit: cover;
}
#bf_mce_layout_2 .bf_mce_copy{
padding: 1rem;
}
#bf_mce_layout_2 .bf_mce_copy h1{
margin-top: 0;
margin-bottom: .5rem;
}
#bf_mce_layout_2 .bf_mce_copy .bf_mce_caption{
font-size: .75rem !important;
margin-bottom: 2rem;
}
#bf_mce_layout_2 .bf_mce_copy p{
line-height: 1.5;
}
#bf_mce_layout_2 button{
position: relative;
margin-bottom: 2rem;
min-width: 150px;
z-index: 1;
}</style>
[[[enter image description here](https://i.stack.imgur.com/MAJs2.jpg)](https://i.stack.imgur.com/kIJKs.jpg)](https://i.stack.imgur.com/hM7uY.jpg)
I placed in a code that works perfectly in dreamweaver into the source code area of Buildfire and for some reason the image is not showing up. I need help with this The code is below:
Your code seems to run just fine, screenshot below:
Maybe a problem retrieving the image? I'd check the network traffic in Safari or Google Chrome and see if the image being requested or not.
If it is being requested then check if you're getting any status code errors. If it is not being requested try adding more information.
I'm fairly new with SASS and I am wondering what is the best method for styling two different top-bars with different styles. What is the best practice using SASS? This question really applies to styling unique instances of anything from the built-in Foundation _settings.scss sheet. I have uncommented and made changes to certain items, and that works just fine as long as you want all instances of that component to be uniform, but when there are two uniquely styled versions of a single component, what should I do?
Agreed (…with your comment. Have an upvote!)
It's difficult to ferret out this kind of information, and that might really be because it's somewhat difficult to do. Not impossible, but not easy.
Global SASS/SCSS changes are just that: global. So while it's easy enough to change the .top-bar styles globally in _settings.scss, overriding individual element instances have proven tricky. Two .top-bars styled independently is tricky, and not to be accomplished using the global variable solutions.
The obvious, and purely CSS, way is to add an ID to each menu (I don't like IDs, but they fit the bill in this instance because of their near-indestructable specificity), and then you should be able to style each menu by simply making each rule specific enough to override the base .top-bar styles. I am in the process of doing this exact thing. So far, so good.
Here's my SCSS:
/* ==================
Page Head Styles
================== */
#utility-nav {
display: block;
width: 100%;
top:0;
width: 100%;
.top-bar.utility {
background-color: white;
margin: 0;
height: 29px;
a {
line-height: 29px;
height:29px;
padding: 0 auto;
color: #777;
background-color: white;
font-size: 14px;
&:hover {
color: #777;
background-color: #f2f2f2;
}
}
}
.top-bar-section {
max-width: 1170px;
margin: auto;
}
}
Which renders to this CSS:
#utility-nav {
display: block;
width: 100%;
top: 0;
width: 100%; }
#utility-nav .top-bar.utility {
background-color: white;
margin: 0;
height: 29px; }
#utility-nav .top-bar.utility a {
line-height: 29px;
height: 29px;
padding: 0 auto;
color: #777;
background-color: white;
font-size: 14px; }
#utility-nav .top-bar.utility a:hover {
color: #777;
background-color: #f2f2f2; }
#utility-nav .top-bar-section {
max-width: 1170px;
margin: auto; }
And here's the HTML it's attaching to:
<!--
Top Utility Menu
-->
<div id="utility-nav">
<nav class="top-bar utility show-for-large-up" data-topbar role="navigation">
<ul class="title-area">
<li class="name"></li>
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li>Careers</li>
<li>Contact Us</li>
<li>Blog</li>
<li>Sign In</li>
</ul>
</section>
</nav>
</div>
<!--
End Top Utility Menu
-->
So, that's ONE menu (the very top 'Utility' menu) overridden. Working on the second, #main navigation menu now.
In short, they don't make it easy. It would be nice if I could leverage SASS mixins to create a .top-bar-2 class and just have at it, but it can't be done at this time.
I am using Joomla Membership Pro component and am having some trouble with CSS styling.
If you click here
http://se24media.net/dc3/index.php/join-us/membership-options/supporter/sign-up
You will see the background is styled nicely but if you fill in the form, click submit and go through to the page which dispalys your membership details it loses all styling (see link below)
http://i60.tinypic.com/33pa4c2.png
Does anyone know why it suddenly loses it's formatting?
Many thanks
It loses the styling because on the first page, the table containing all the fields is wrapped with <form> tags like so:
<form id="os_form">
<!-- Table with fields are in here -->
</form>
and the following CSS has been given for #os_form
#os_form {
background-color: #FFFFFF;
background-image: url("/dc3/images/news_header.gif");
background-repeat: repeat-x;
border-color: #868687;
border-radius: 12px;
border-style: solid;
border-width: 0 2px 3px 0;
color: #000000;
float: left;
font-family: 'Source Code Pro',sans-serif;
height: auto;
margin: 0 40px 40px 50px;
max-width: 100%;
opacity: 0.9;
padding: 40px 20px 20px;
width: 85%;
}
The second page simply displays a table with the class os_table so style this table, you will need to add the following to your CSS file:
.os_table {
/* code here */
}
Hope this helps
In my asp.net mvc4 view I have some nested divs to show an image and under it a text like below:
<div id="Outer1" class="elementStatus">
<div class="image"> <!-- THIS IS THE IMAGE -->
<img id="MyImg1" src="#Url.Content("~/images/Image.gif")">
</div>
<div class="text"> <!-- THIS SHOWN THE TEXT UNDER IMAGE-->
Statuts Text
</div>
</div>
and the css:
.elementStatus
{
visibility: hidden;
}
.image{
float: left;
margin-top: 2px;
padding-top: 1px;
padding-left: 10px;
width: 35px;
}
.text{
float: left;
margin-top: 1px;
padding-left: 14px;
padding-bottom: 2px;
width: 35%;
font-weight: bold;
font-size: 1em;
}
I want that the image in the first div to be centered horizontally and vertically in the div where it is placed. The same for the second div, I want the text to be centered horizontally and vertically within its div. So how to do it?
Please, do not downvote!
Recommend a background image:
.image {
background-image: url('~/images/Image.gif');
background-repeat: no-repeat;
background-position: center;
background-size: 35px 35px;
}
For the text:
.text {
text-align: center;
}
For vertical text alignment:
.text {
line-height: 35px;
height: 35px;
}
This is a pretty broad question but it's easily solved using flexbox (assuming you're supporting newer browsers). Going to remove vendor prefixes for the sake of clarity but you'll want something like this:
#Outer1 {
display: box;
box-align: center;
box-orient: vertical;
box-pack: center;
}
http://jsfiddle.net/VqwLH/
Since you have updated saying you need support for older browsers, I think you can use display: table-cell for the parent container:
#Outer1 {
display: table-cell;
height: 500px;
width: 500px;
border: 1px solid red;
vertical-align: middle;
text-align: center;
}
http://jsfiddle.net/VqwLH/1/
I need some divs to be center-positioned and to fit their content width at the same time.
I am now doing it like this:
.mydiv-centerer{
text-align: center;
.mydiv {
background: none no-repeat scroll 0 0 rgba(1, 56, 110, 0.7);
border-radius: 10px 10px 10px 10px;
box-shadow: 0 0 5px #0099FF;
color: white;
margin: 10px auto;
padding: 10px;
text-align: justify;
width: -moz-fit-content;
}
}
Now, the last command "width: -moz-fit-content;" is exactly what I need!
Only problem is.. it works only on Firefox.
I also tryed with "display:inline-block;", but I need these divs to behave like divs. Namely, every next div should be under, and not inline, the previous.
Do you know any possible cross-browser solution?
At last I fixed it simply using:
display: table;
Mozilla's MDN suggests something like the following [source]:
p {
width: intrinsic; /* Safari/WebKit uses a non-standard name */
width: -moz-max-content; /* Firefox/Gecko */
width: -webkit-max-content; /* Chrome */
}
In similar case I used: white-space: nowrap;
Is there a single declaration that fixes this for Webkit, Gecko, and Blink? No. However, there is a cross-browser solution by specifying multiple width property values that correspond to each layout engine's convention.
.mydiv {
...
width: intrinsic; /* Safari/WebKit uses a non-standard name */
width: -moz-max-content; /* Firefox/Gecko */
width: -webkit-max-content; /* Chrome */
...
}
Adapted from: MDN
I use these:
.right {display:table; margin:-18px 0 0 auto;}
.center {display:table; margin:-18px auto 0 auto;}
I was looking for a way to prevent a long line of text from outgrowing past its container, and max-width: fit-content worked in Chrome, but not in Firefox.
I found a workaround: if the element is the last displayed subelement, setting display: table-caption; and caption-side: bottom; does have the same effect, together with display: table; on the parent object.
Why not use some brs?
<div class="mydiv-centerer">
<div class="mydiv">Some content</div><br />
<div class="mydiv">More content than before</div><br />
<div class="mydiv">Here is a lot of content that
I was not anticipating</div>
</div>
CSS
.mydiv-centerer{
text-align: center;
}
.mydiv{
background: none no-repeat scroll 0 0 rgba(1, 56, 110, 0.7);
border-radius: 10px 10px 10px 10px;
box-shadow: 0 0 5px #0099FF;
color: white;
margin: 10px auto;
padding: 10px;
text-align: justify;
display:inline-block;
}
Example: http://jsfiddle.net/YZV25/