Adding module next to existing in Joomla - joomla

in my Joomla template is of course the component included:
<jdoc:include type="component" />
That fills the whole width of the parent container at the moment (with margins). The parent container has a background that stretches from the top of the site to the bottom of the component. What I want to do is add a position after the component to place a module there, but I want it next to the component.
But once I make the component float:left and add a width:80% or something so the module on the new position will float next to the component. But, the background from the parent container changes when I add a width other than 100% to the component and stops before the component begins.
How can I have the component have a smaller width than 100% and float:left with another position next to it without changing the background of the parent container?
Edit: I like to add that I cannot use overflow:hidden on the parent container since another element will be clipped if I do. Adding a background to component and the other position won't work either since the original background is wider.
Edit2: I found a solution to my problem. For future reference if anyone is interested: the float clearing part on this page described my problem and clearing the float by adding a <div style="clear: both;"></div> after the last floating element solved my problem. If anyone has a cleaner, better solution I love to see it!

I'm not sure which version of Joomla you're using, but if it's 3.x, then you can use the clearfix class that comes with Bootstrap. It's a cleaner and more efficient approach to adding a clear div at the end of the parent element. So simply add the following to your parent container:
class="clearfix"
If you're using Joomla 2.5 then you can add the following to your template css file:
.clearfix:before,
.clearfix:after {
content: '\0020';
display: block;
overflow: hidden;
visibility: hidden;
width: 0;
height: 0;
}
.clearfix:after {
clear: both;
}
.clearfix {
zoom: 1;
}
and then add the class as mentioned above.
Hope this helps

Related

Correct use of Sass parent selector?

I'm trying to make all links on my page have a custom underline similar to this.
Here's what I have so far of a menu that's going to use this feature:
CodePen
The underline, instead of appearing under each link, appears under the "toolbox" div (the link objects' grandparent).
I've tried just making the first CodePen but with the features SCSS allows you (& and nested rules), but I seem to be missing something and won't even show the underline. I'm guessing it has something to do with my use of the parent selector.
How do I make my current code work correctly? If the issue is with my use of parent selectors in general, what is the correct selector to use in this case?
(Stack Overflow is making me put this)
You are using position: absolute in ::after therefore the underline will have absolute position not related to the <a>. Just add position relative to <a> thus inclosing the absolute ::after content to it.
.navbar {
background-color: #191919cc;
padding: 10px;
border-radius: 10px;
a {
position: relative; // here
margin: 0 10px;
}
}
codepen link: https://codepen.io/ashwin-chandran/pen/BaZjQLz

How to apply custom style to Google reCAPTCHA?

https://developers.google.com/recaptcha/docs/display
I would like to know how to apply styling to the image selector.
grecaptcha.render(
container,
parameters
)
According to the document: container is the HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself.
Then, I try to apply css to the container and pass it to the render method. However, it only applies to the grecaptcha-badge div.
I have no idea how to adjust the image-selector position.
visibility: visible; position: absolute; width: 1303px; top: 146px;
It seems the style is controlled by the google js: https://www.google.com/recaptcha/api.js
What could I do to edit the image-selector's style?
This question is quite old, but for those who want to customize the reCAPTCHA here is a solution: https://custom-captcha.com/
It has no image captchas but instead uses the new reCAPTCHA v3 in the background. You can customize the logo, the text, and the brand name as well. Also you can apply any CSS you want to it.

fluid Img component is shrinking when its under Link component

I am currently using gatsby for a project and when i put gatsby Img component inside Link component so that it's clickable, the image gets shrinked to its parent component(the link component). i know gatsby fluid Img stretches or shrinks to its parent's width but i want it to show as full image. i tried using fixed instead of fluid but it didn't work and it's even tried specifying width while querying.
code
frontend part
It seems clearly a CSS issue since your <Link> is shrinking to the text (sssssssssss) length.
Debug your .thumbnail class and the component to see what's happening inside. For example, a CSS rules like the following will work but maybe don't fit your design specs:
.thumbnail{
position: relative;
width: 100%;
}
.thumbnail a,
.thumbnail img {
width: 100%;
}
Take a look at the resultant HTML output the adjust your selectors, since gatsby-image wraps the <Img> inside a nested structure, what may affect your CSS rules.
It seems that you are using Bootstrap (hence the w-100) so try adding it to the wrapper (<Link> component),

flexbox height or big image background

i actually really like this approach that is big img background, but i want it to be fluid with windows's height as well (before we scroll down to other section or div), so before reaching mobile screen, its height can always stretch and fill the whole browser screen while logo & content inside is always in the middle
i like this site, http://peterfinlan.com/, i emailed to enquire but never get any response about how to make it, i try to follow its css, but i just couldnt make my header as its, i dont really see any other flexbox css other than div.hero-content, and yes i am new to flexbox, does it have javascript or what?
can you help me?
To make a div fill the site using flex box, you need to do the following:
<body>
<div id="mainWrapper">
<div id="headerWrapper">
<!-- HEADER CONTENT HERE -->
</div>
</div>
</body>
with the following CSS
html, body {
margin: 0;
padding: 0;
height: 100%;
}
#mainWrapper {
display: flex;
flex-direction: column;
min-height: 100%;
}
#headerWrapper {
flex: 1;
}
See an example in action here.
In this particular context, however, you don't necessarily need a flexbox as #mainWrapper already stretches over the complete site.
While flexbox is nice, don't force its usage just because it's new. Getting rid of flexbox and #headerWrapper wouldn't do any harm here.
Please note that I did not include any vendor prefixes here, so it may not work in all browsers as is. I recommend you use a tool like autoprefixer before you deploy your CSS.

Can I create a fixed grid with singularity?

Last week I discovered the Compass grid Singularity, which is impressing.
I'm going to design my next project based on Singularity.
Unfortunately I need to use a fixed grid (width=1024px).
Is it possible to design a fixed grid with Singularity?
Thanks
Singularity works a little bit differently than other grid systems in that it only concerns itself with the grid and not the container. If you'd like a fixed container, simply add width: 1024px; to whatever your container class is, and you'll have a fixed width container.
You’re in luck because yes it is possible!
Just set width: 1024px; on whatever element contains your columns:
HTML:
<div class="container">
<article>stuff</article>
<aside>stuff</aside>
</div>
Sass:
.container {
width: 1024px;
margin: 0 auto;
}
Your markup may be different, but that is one solution.

Resources