I'm trying to create a new theme in Wordpress. So far I only used child themes or messed around with some php, html and css seperately. I downloaded _s starter theme and right now I'm somewhat failing with the css. I'm trying to move the widget-area/sidebar to the left side, but no matter wat I try it will stay at the bottom of the page, and the content-area will just get decreased to 75%.
This ist what I tried:
.content-area {
float: right;
margin: 0 0 0 -25%;
width: 100%;
}
.site-main {
margin: 0 0 0 25%;
}
.site-content .widget-area {
float: left;
overflow: hidden;
width: 25%;
}
I know this is pretty basic stuff and I feel kind of dumb right now, but no matter what I do the sidebar won't come to the side. I also tried setting pixel width of 200px for content and widget-area. I'll keep trying, but if somebody might know the answer and could help me I would be really happy! I would prefer not to set a z-index.
Thanks in advance, Carlos
EDIT: this is how it looks like in chrome site inspector
<div id="primary" class="site-main">blabla</div>
<div id="secondary" class="widget-area">blabla</div>
EDIT2: Could it have something to do with the dummy data that I imported? I mean all the dummy content in the widget area should not be a problem, as I set overflow: hidden; am I right?
It’s hard to say without seeing your HTML, but I think your problem is that the content area width needs to be set to
75%.FWIW, here’s a simple example of a fixed-width sidebar layout using
flexbox: