As you may have noticed, it's been a few days since The Web Thought has changed its layout. Now it is fluid.
Not knowing exactly how Blogger templates are built, I searched the Internet a bit to find a way to achieve that, and I must say I didn't find much... Everything I found was not really working for me, because it mainly focused on changing widths in pixels, while I wanted to use percentages. Finally, after playing a bit with the Design panel, I managed to make The Web Thought fluid.
I tested it with different browsers and it looks good. Please let me know if you find issues that I'm not aware of.
Let's see how to do it!
First of all, go to Blogger and select the Design tab and then Edit HTML. If you use Blogger in draft, select Template and Edit HTML.
Now you can see the HTML code of your template. Search for "content.width" in your browser and you should find a section of the template that looks like:
<b:template-skin>
<b:variable default='930px' name='content.width' type='length' value='1000px'/>
<b:variable default='0' name='main.column.left.width' type='length' value='0px'/>
<b:variable default='360px' name='main.column.right.width' type='length' value='380px'/>
<![CDATA[
body {
min-width: $(content.width);
}
.content-outer, .content-fauxcolumn-outer, .region-inner {
min-width: $(content.width);
max-width: $(content.width);
_width: $(content.width);
}
We need to change the following part:
.content-outer, .content-fauxcolumn-outer, .region-inner {
min-width: $(content.width);
max-width: $(content.width);
_width: $(content.width);
}
Which is the style for the content of our blog. In particular, we need to change the $(content.width) variable. As you can see, the variable is set with the following piece of code:
<b:variable default='930px' name='content.width' type='length' value='1000px'/>
but if we try and change the value there, we will end up with a general template syntax error. That is why I decided to change it directly in the related style.Consider that the values I have in The Web Thought might not be appropriate for your blog. Just change the values according to your needs and taste.
BEFORE SAVING THE TEMPLATE, make a copy of your original template, saving it to your PC, change the $(content.width) variable, and then PREVIEW the result. When your happy with the new look of your blog, save the template (applying it to your blog).
What I have - as an example - for The Web Thought is the following:
.content-outer, .content-fauxcolumn-outer, .region-inner {
min-width: 1000px; /*$(content.width)*/
max-width: 1280px; /*$(content.width)*/
_width: 100%; /*$(content.width)*/
}
As you can see, I decided to have as min-width 1000px, while as max-width 1280px. This will prevent the content to be overstretched. Then I set the width to 100%.Again, please let me know if you found something wrong in the new layout.
Happy coding to all.
Thanks for the hints for a blog width adjustments!
ReplyDeleteNeed help. I have some gdgets beside my blog but noe its way at the bottom. How can i put it back at the side
DeleteYour site with basic liquid layout is in Arabic, so not very helpful for most of us.
DeleteGlad you've found it useful. Take care!
ReplyDeleteThanx for the instructions, I've just used them on my blog and it seems to be working fine!
ReplyDeleteGreat Black Queen!
ReplyDeleteLet us know your blog url so that we can see it in action!
Thank you for posting. For some reason it is not working with my blogger Simple template. I've added a background and set the columns in the layout design. Applying the code shifts my header and columns over to the sides, awkwardly overlapping the background framing my blog. :l
ReplyDelete@No Ordinary Kinna:
ReplyDeleteI've visited your blog but probably you revert to the default style. The background in any case is seen only a the top (its height is not enough for my resolution - 1280x1024). The problem with the columns width is that you should try and see what's the best for a large resolution but considering lower resolutions too. I invite you to play and try until you find a suitable value. And please follow the instructions with care - and do make a backup of your template before applying.
Good luck and let me know.
Hi! I tried doing the same for my blog but can't make it work. My layout still seem to wide for regular screensize laptops. But it works find for wide screen desktops.
ReplyDeleteHi Kumiko,
Deletejust play around with this two values:
min-width: 1000px; /*$(content.width)*/
max-width: 1280px; /*$(content.width)*/
and find the appropriate screen size. Look especially at the min-width which is the minimum width (1000px could be too much for laptops!).
Take care!
Hey there! Great post! Thanks :)) it's working well! I have a question though: is it possible to do the same for the sidebar? Because right now my layout is only partially fluid. I'd like for the right sidebar to automatically resize as well. Could you perhaps help me figure it out? :o
ReplyDeleteThanks for commenting the post.
DeleteAs for the sidebar, I have done a quick search in my template designer and found that - possibly - the place where to try and change the sidebar width is the following variable:
$(main.column.right.width)
I haven't played with it, but, if you dare, you can try. Please be sure to backup your whole template before making any changes.
Thanks for the fast reply! I had sorta figured it had something to do with that, but had no idea how to move forward from there :o Ive been messing around with it a little bit, but tbh im still no closer to a solution ;o my experience with designing websites/templates is tbh very limited. Any chance you could take a closer look for me? Ill follow your blog, even mention u in/on mine if u want :P
ReplyDeleteJust a little help. I don't have much time to play with it.
DeleteSearch for:
.main-inner .column-right-outer {
width: $(main.column.right.width);
margin-right: -$(main.column.right.width);
and change it to:
.main-inner .column-right-outer {
width: 100%; /*$(main.column.right.width);*/
margin-right: -100%;/*-$(main.column.right.width);*/
Press "Preview". Now you see that the right sidebar is responding to the 100% width? If you play with those two values (100% and -100%) you might find what you are looking for.
My opinion: I wouldn't change too much the values of the columns, because I noticed some strange behaviour. At least on my blog.
Please REMEMBER TO BACK UP YOUR TEMPLATE. I won't be responsible for strange results :-)
Fabulous! Excellent explanation. Thank you! Worked.
ReplyDeleteSee it in action at:
http://tweaksforpc.blogspot.com
Great help! Found what I was looking for. Thanks.
ReplyDeleteHi
ReplyDeleteI was wounding if it is possible to do this with the new Blogger Template Designer part. In the advanced section under add CSS. If you can help that would be grate thanks.
Yes you can. Usign the HTML section, but it depends on the template you have chosen.
DeleteDon't work for me ._.'
ReplyDeleteHi. WOW! Thanks! You're great. :D
ReplyDeleteAnyway, tweaking this part will also help:
body {
min-width: $(content.width);
to
body {
min-width: XXXpx; /*$(content.width);
Thanks!
This better?:
Deletebody { min-width: 100%; }
This is pretty cool! But I couldn't implement this code on my Blog! Bad Luck.
ReplyDeleteHey, you run such a splendid website, on it! And there is one thing that I would like to ask you. Is it a paid theme that you buy online or you turned to a common one?
ReplyDeleteThanks!
DeleteThe template used here for the Web Thought is one of the basics by Awesome Inc.
I really want to try this but every time I edit the HTML on my blogger, the mobile version is no longer adaptive to the current web design and I have to redo the entire blog to fix it...
ReplyDeleteThat is strange. As you can see my blog is working correctly. Be sure to follow the above instructions.
ReplyDeleteThanks! I found out that my template, for no good reason, made max-width the same as my min-width! Quickly fixed it into something a bit bigger. :) Now, it is fluid!
ReplyDeleteAssaf Koss,
Professional Author & Blogger,
See my Blog & eBooks at AssafKoss.blogspot.com
I chose a blogger template then edited it but I cannot get the background to auto adjust. My html doesn't look anything like what you have as an example as to what to look for. It's mostly the templated html that was there already.
ReplyDeleteI use an awesome inc template. Check carefully the code because it might confuse you.
DeleteThanks Marco for the info. 2 things - Is there a way to center a picture in the header, it slides to the left on a larger screen and why do you still use a nav bar when it is easy now to remove it?
ReplyDeleteThanks in advance
Ric Old
Ric,
DeleteIf you need to center something you have to find the element in HTML and wrap it in a centred div or something.
As for the nav bar, I don't understand what you mean.
Thanks.
Hi! I really need help. My website is sartorialust.blogspot.com
ReplyDeleteMy navbar is an image map and it looks perfectly aligned in my browser but for others, it isn't. I tried these codes but they dont seem to work. :( Help!
Btw, I'm using the Simple template. Hope to hear from you soon! Still trying to figure out how to make it fluid.
ReplyDeleteIf your nav bar is an image map, you have to make it fluid as well. I don't know where the code of the navbar is, but the moment you find it you have to use percentage for the width, otherwise it won't work.
DeleteI'm sorry I can't help you more, but every blog is different and it takes time to find the CSS related to each page element.
Hi Marco! Thanks for the answer. The navbar's width is 1134px. How do I make it a percentage?
DeleteChange 1134px into 100%. If it doesn't work, try different values like 90% or 80% (those are more likely to work as you expect!)
DeleteThis is the navbar's code if it helps:
Delete<*div style='position: fixed; top: 0; left: 65px; z-index:123;'> <*img alt='' src='http://i.imgur.com/9aDRhbk.png' usemap='#map1367403623280'/>
<*map id='map1367403623280' name='map1367403623280'><*area alt='' coords='91,18,103,28' href='/' shape='rect' target='_self' title=''/><*area alt='' coords='162,16,211,30' href='http://sartorialust.blogspot.com/p/about.html' shape='rect' target='_self' title=''/><*area alt='' coords='311,17,337,27' href='http://sartorialust.blogspot.com/p/faq.html' shape='rect' target='_self' title=''/><*area alt='' coords='436,17,506,27' href='http://sartorialust.blogspot.com/p/contact.html' shape='rect' target='_self' title=''/><*area alt='' coords='588,16,665,26' href='http://sartorialust.blogspot.com/p/blogroll.html' shape='rect' target='_self' title=''/><*area alt='' coords='915,10,935,29' href='http://www.blogger.com/follow-blog.g?blogID=7036237920987038780' shape='rect' target='_blank' title=''/><*area alt='' coords='948,12,969,30' href='http://twitter.com/jelinecatt' shape='rect' target='_blank' title=''/><*area alt='' coords='985,9,998,32' href='http://facebook.com/sartorialust' shape='rect' target='_blank' title=''/><*area alt='' coords='1013,9,1032,31' href='http://instagram.com/jelinecatt' shape='rect' target='_blank' title=''/><*area alt='HTML Map' coords='1132,40,1133,41' href='http://www.html-map.com/' shape='rect' target='_self' title='HTML Map'/>
Why are you saying that it's 1134px wide?
DeleteTrouble is the coords! You can't make them dynamic. I don't think you can change that and make your navbar fluid. You need to use another type of navbar, IMHO.
Anybody else can help?
Wait, so does this mean I can't use an image mapped navbar?
DeleteThat's right. Sorry.
DeleteHi Marco! It's me again. Sorry for too much questions but do you know the code for having a navbar like the one in these blogs? > http://www.tapeovercrystal.com/ & http://neonblush.com/
DeleteNo idea about the code but I'm pretty sure that if you play with blogger dashboard you can create one.
DeleteBrilliant! Thanks, now my website/blog doesn't look like a monkey made it! bensmcserver.blogspot.com
ReplyDeleteThanks!!
DeleteThis comment has been removed by the author.
ReplyDeleteYou need to look into your HTML. Never thought about it...
DeleteI tried but this code but unfortunately it didn't work on my blog . Any other ideas?
ReplyDeleteWhew, this is the only thing that worked for me after searching. Thanks a bunch to you!! :))
ReplyDeleteThanks for sharing such interesting information in such detailed format.
ReplyDeleteGreat Post. I was searching for this. Your min-width tip was awesome.
ReplyDeleteCan we a set min-width for right-sidebar?
instead of 360px if we write some%, say 35% then it also resizes! Have you noticed it?
Can we set min-width for right sidebar?
Thank you so much. Great Work. Cheers!
ReplyDeleteThankyou brother
ReplyDeleteYou're very welcome
DeleteA few year later, and this still works. Thanks!
ReplyDeleteThank you for dropping a line.
DeleteThank you so much for this easy tutorial!
ReplyDeleteIt first didn't work but when I changed the body { mind-width: $ to
body { min-width: 830px
it worked! So thank you a lot!
Excelent! Thank you so much!!
ReplyDeleteThanks so much marco...i did mine like this and it works so well on both androids and destktops(ie7 and above)
ReplyDeletebody{ min-width: 1000px; max-width: 1300px; width: 100%; }
so it was very easy for me to use percentages in my 3 column layout: .divleft{ width: 20%; } .divcontent { width: 60%;} .divright{ width: 20%;}
and it is working fine. Useful for people.. I love you..
Thanks to you!
DeleteIt looks like it is exactly what I was looking for.
ReplyDeleteBut Marco, could you pls define or explicate the term "fluid"?
fit any screen resolution ------- does it mean fit any desktop screen, or fit any mobile screen or fit both and display a blogspot in the best possible way, or display a blogspot on mobile screens with the least problems and distortions comparing to the desktop view?
Are you talking about regular templates or about templates that have been already pre-designed as responsive?
And what should be blogger settings for regular and responsive templates on mobile devices?
Template › Choose mobile template
On mobile devices, show a mobile version of your current template.
Yes. Show mobile template on mobile devices.
No. Show desktop template on mobile devices
---------------
Mb this topics or Qs go beyond the issue in hand. But they are very important and confusing for so many blogspot bloggers
Thx
The fluid concept explained here fits for desktop screen. If you need to guarantee a correct mobile version, use the one from Blogger itself which works great.
DeleteThe template should be pre-designed (I use one from Blogger) and it's a responsive one.
Hope it helps.
Marco,
ReplyDeleteI highly appreciate your instant reply!
template should be pre-designed (I use one from Blogger) and it's a responsive one. ---- are you talking about these templates?
https://www.blogger.com/blogger.g?blogID=6666666666666666666#template/src=dashboard
Simple
Dynamic Views
Picture Window
Awesome Inc.
Watermark
....
....
If yes, are they all pre-designed as responsive?
thx
please let me know if you found something wrong in the new layout. -------- this emulator http://www.mobilephoneemulator.com/ does not display your sidebar at all. Why?
ReplyDeletebut the body looks great!
I can't help you more than what I said.
ReplyDeleteIt looks good to me.
ReplyDeleteI changed my settings as you said but my text does not fit the screen like yours. For instance, when I minimize my browser window to half a screen your text adjusts to the new screen. Mine does not. Any help would be appreciated
ReplyDeletePls i have a problem...when i view my blog..dey text r too long.it reaches to tge right..how do i change it..my blog is joanoluchi.blogspot.com
ReplyDeleteExcellent post.
ReplyDeletehey.. my whole blog view have changed to small screen resolution . do u have any fix for that???
ReplyDeleteExcellent post
ReplyDeleteThis worked well. Thank you!
ReplyDeleteWow, it is a miracle. I will definitely try it. Thanks for the share.
ReplyDeleteHurrah, that's what I was searching for, what a information! present here at this blog, thanks admin of this site.
ReplyDeletePlease provide the demo version of that tweak
ReplyDeleteWhew, this is the only thing that worked for me after searching. Thanks a bunch to you!! :)
ReplyDeleteHow come i cannot find content.width in my html
ReplyDeleteThanks for sharing this amazing and informative article.
ReplyDeleteLooks and works perfect, lack of this feature makes most of blogs unusable.
ReplyDeleteHello thank for your post. Please my blog posts looks good on the desktop, on the mobile too but on the mobile in not up to the mobile device width making the content shifted to the right. Please if you can help me with that I will be very happy. Thank you. My blog site is :https://healthlovezone.blogspot.com/
ReplyDelete