Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Post Date and Title

For a long time I knew I wanted the date to be displayed calendar style, as in month, day and year all one on top of the other. So I found this tutorial to help me achieve that look. Only thing is I had some trouble understanding it and getting it to work, so I tried an other one of her tutorials with a very similar effect (just doesn't look like a calendar) and this one worked better with less tweaking and was easier to understand. Here are the changes I did to that particular code.



- changed the color of the circle and added a radial gradiant (though it doesn't show much because there isn't enough of a color difference between my 2 colors)
- moved the date header less to the left until it looked good. I find it strange that it disappears if it goes beyond the main container though, but at the same time I do like the effect it gives to have it slightly cut off.
- removed the letter-spacing between the letters of the month and year, it just made it look very odd
- made the year slightly smaller than the month, since it's 4 letters compared to 3 for the month
- moved the whole date up a bit with negative margins so it would look right (before it looked like there was too much space above the month, and too little below the year)
- changed the color of the text to white for all
- changed the font to the same as the post font



I really like the effect of the box shadow being wider than the white border and showing beyond it. Would not have thought to do that. Might use that elsewhere in my design now.

I also changed a few things about the post title:

- post body clear both so post text would appear below the date and not next to it; also this will prevent the title text to overlap the body text if ever the post title is really long, some blogs need to add this bit of code as I've noticed they have this problem which is more noticable on a phone
- moved the post h2 (aka title) so it would be almost lined up vertically with the center of the date circle using padding, and so it would clear the circle, too.

I'm not sure how, or where the code is, but if there are 2 posts on the same date, then the older post, or the one lower on the page, does not have the date next to the title. Nonetheless, it looks just fine.



Part of me want to delineate the title a bit more than this. So I tried putting a shadow-line below it, but I'm not quite sure if I like it... Also it might look weird if I add something below it (like labels, author, comment links). I'm keeping this option in my head, but for now I'm removing it.


PS this screencap was taken before I changed the font face of the date.

Now before I get too ahead of myself, I'm going to look into having a thumbnail and post summary of each blog post on the main page/ index pages (I know, you already got a glimpse of it in here, but it was not working correctly). This will change things considerably for how I want the rest to look.
Continue Reading...

Header: Search bar

I'm almost finished coding for the header section of the new layout! So far I have the logo down, the pages navigation, and the main navigation and the social media buttons. So I'm only missing the search bar and the tagline.

For a long time I knew where I wanted the search bar to be displayed within the header section, but really had no clue as to the esthetics of it.

As I always do when I don't know where to start, I search for what's already been done until I find something I like. I found this tutorial that I really liked so I started implementing it.

After some color changing of the code, I ended up with this:



For some reason, I could not get the actual search function to work with this code, and try as I might I could not understand WHY. Also, I had a really hard time making this responsive since the Go circle was coded with ems. As I learned when doing the social media buttons, responsive circles with text inside are rather tricky, and well kinda impossible to achieve.

I let it be for a while while I worked on the main navigation, and once that was done I came back to it. I then thought it looked too busy and fancy, and I wanted to simplify the design of it. And also find a way to make it more responsive.

So I found this code instead. I forewent the option of having placeholder text because that's done with Javascript and I don't know Javascript. I'm trying to stay within HTML5 and CCS3.

In the end, I could only make the width responsive, and not the height. Which I guess in hindsight is also true for the navigation menu. This is because font cannot be made truly responsive (as in scale to the width of the browser window), and this element is in major part font dependent. Yes you can define it in ems, but that means it will be adaptable and not responsive/scalable. If that makes any sense...

Anyway, once it gets to the point where it no longer looks proportionate in the design, there will be a breakpoint that will completely rearrange the layout, and I will then be able to change the look of it so it's once again proportionate. Which will mostly be adjusting the font size.

Making the width responsive was a bit more complicated than I would've thought, and necessitate a lot of cascading widths to be set.

The cascade for this element is like so:
body--> header --> search bar container 1--> search bar container 2--> search input and search button

The header is 80% of the body, the search bar container 1 is 67% of the header (because it's next to the logo which together make up 100% of the width), the search bar container 2 is 50% of the space beside the logo with a left padding of 50%(to push the search bar to the right), the search input is 70 % of that space while the search button is 30% (which together make up 100%). Did you follow that? Yeah, I know complicated.

I changed the color scheme of the original tutorial, removed shadows to make it simpler, and that was pretty much it for this guy.




Continue Reading...

Header: Social Media Buttons

My quest for the social media buttons as to make them with pure CSS, as I did with my main navigation. That means that the social medianess, as in the font or icon of each button, would have to be rendered by a font. I have yet to find a social media font that has all the ones I want: RSS, email, Facebook, g+ and Bloglovin. But then again if I made small images and put them inside the button, they would be easily scalable... hmm, food for thought.



I'm trying to stay away from images as much as possible because the nature of my blog means the content is already pretty image heavy. So as to not increase load times beyond that, I'm trying to minimize image sizes for the blog layout, because afterall those are the images that are loaded every.single.time a page on my blog is loaded. Make sense?

I wanted simple yet unique social media buttons. Not just a circle, not just a square, definetely not a bunting as that is being done wayyyy too much, but something different. After a lot of searching and pondering, this idea came into my head: a square with 2 facing corners that are rounded. And a border. And a radial gradient to up the fanciness :)

I used this article to help make it responsive. In the end, the tutorial was more complicated than it needed to be, and well, didn't even work. But I couldn't have figured it out without it, so it's worth a mention.

Basically all you need to do is set the width in %, set the height to 0, set the TOTAL padding equal to the width in %. Because there's text that I want centered in the shape, I set the padding-top first, then the padding-bottom for it to look like it's even on all sides. Of course you complicate things if you put a border, but again you can just use the border-box trick I mention here.

Then, round 2 opposing corners (I rounded by 40%, so they remain responsive), add radial gradient, and you're done. Each button is a seperate span element. I will need to change the font so the actual icons appear, but you get the idea.



Still need to add a hover effect, which might be a text-shadow, or invert the radial gradient direction.
Continue Reading...

Content Main Navigation

Continuing on my quest for the header graphics and layout, the next big element is the content navigation. I already decided on my Main Navigation categories, and sub-categories previously, now it's time to find a nice way to display them and make them... navigatable.

I had a hard time coming up with something here. Most blogs I frequent have just a simple text navigation. Some have effects on hover, but most do not. That's too plain for me. I also wanted the navigation links to be easily made responsive for the different designs. I knew I wanted only the 3 main categories to be displayed, and then the sub-categories appear on hover, but I wasn't exactly sure HOW that would work, or how I want it to look.

While I mulled over my possibilities for coding this part, I went ahead and tried to make some graphics for the main navigation. I wanted them to keep in with my doodle graphics that I'd already made for my pages navigation and my logo. I came up with these:



I wasn't 100% sold on them though, I couldn't figure out a way to make the space between each tag/category more transient, gradual, whatever, since I wanted each of the categories to be a different color. And also, I made the space between the 2 lines transparent, so that on hover there would be a background color that would only show through that part, but instead all I see is a colored line along the bottom on hover, as you can see for the first category in the picture above. I can't figure out why it's doing this.

Then I finally found a tutorial for a navigation bar that had what I wanted, except it was text based, no graphics. I figured I might as well just try and make the navigation work, and then worry about whether I can change the text to graphics, if I still wanted that.

The code I found, a dropline on hover navigation bar, is based on list items, which actually conventional menu bars are based on, not just images with links all in a line like I did my last one. The thing with list items is that you can easily have sub-list items, aka Categories and Sub-Categories. Also, text is more easily scalable while still keeping it's crispness at whatever size, which will be super important for viewing on high pixel density devices (aka retina screens).

Took me a long time fiddling with this code to make it work the way I wanted it to. It's one thing to find the code, and another finding a TUTORIAL with the code. I had to figure out what each line of code did exactly, since it's not exactly explained... and which code was redundant, because there was redundant code.

Here are a few things I changed to suit my needs:
- changed the text-align to center
- changed the width of the li a to 33.3333%, since I have 3 main navigation... The thing I haven't figured out is why I need to set the width to li a and not li only... but do whatever works right?
- changed the li background color to white
- apply gradient background color and add round upper corners to li a elements so they are defined more as individual tabs
- applied different background colors for the 2nd child and 3rd child of the li a so each main category is a different color like I wanted
- changed the active and hover state of li a to have a white background and for the text to be colored the respective color; added a colored border to keep the tab definition, but since border are fixed px and not % to make them look good, it's harder to make them fit and be responsive, so had to change the width of li to a guestimated # that would not break the page, in this case 33%; also had to add a border to the non active state or else it would appear as if the tabs are growing/moving to the right on hover.



Up to that point it was fairly straight forward, it was the sub-list that gave me a lot of trouble, both in understanding the existing code, and changing it to what I wanted. For one, the sub-list inherited most of the code from the main list, like the round upper corners, so I had to override by adding a 0px radius to the upper corners.

Second, the sub-list ul li is by default a little to the right of the list, like a "Tab" indent, or nesting of the sub-list under the list, which I could not figure out how to get rid of. The reason why it's not evident for the main code which I am basing this on is because he put a background color to the container containing the ul, and he used fixed pixels. If I did the same using % for the width so that it's responsive, that container extended past it's own container (past the header container) because of the indent, it keeps the same width it's just moved to the right. So I had to set the background to white, and make it less than 100% or else it would extend past still.

And this is why sometimes it's good to explain to someone, even if that someone is invisible. I just realized that if I set my background to transparent, then I CAN just move the ul container and make everything flush!! This won't be responsive if I move it by %, but with -40px at the left margin everything's good and responsive!! 40px seems to be the default indentation for sublists in this case.

So for the sub-list I changed:
- set upper corner radius' to 0em
- set margin-left to -40px

After all that, I could not get the sublist to be the exact same width as the main list, because of the border I added to the main list. Though even adding borders to the sublist didn't work. Finally, I found a bit of code that worked its magic. Basically, the problem is that the border is not part of the width but added to it, so this bit of code tells it to be included in the width. Magic I tell ya! I found it here.

The one thing that will most probably cause me trouble is when I want to add more sub-list items, I'll have to change the set width % to accomodate for it, or else it will go below the existing ones. Also, I need to work around the fact that if a item text is longer than the 33% width, it will do a line break and continue writing, whereas I would want it to shift the other list items for the to be one after the other on the same line. So I might have to fiddle with this part a little more, remove the tab definition (rounded corners) for the sub-list and not give it a defined width, and not center the text but left align it. Yeah, I'm probably gonna have to do that... but I'm pretty tired of fiddling with this part of the code, I want to move on to something new for a bit.

With that, I'm pretty satisfied with my navigation, and I'm not planning on adding a background image to them. But, I do want to change the text font, which is an entire different post, as this one is pretty long. And also because I haven't figure out how to do it yet.
Continue Reading...

Translucent Backgrounds and Round Corners

One of the rules defined in CSS3 is opacity of background images. The moment I read that I knew I'd be taking advantage of that feature to do something I had in my head.

I wanted to make my outer-wrapper container translucent, so that it frames the entire blog but still shows a bit of the beautiful background I've got going on. So I set the color to white and then added the little bit of code for opacity. Easy peasy! Right?!



Wrong! Turns out, this affects everything inside the container. All the text all the images are now also transclucent. Not what I was going for!! So after a bit of digging, it turns out the best (only?) way to do this is to create a transclucent png image and use that as a background image.

So I just created a small wide transclucent white image to use.

I used the same CSS code as for my body background. Size 100%, fixed, repeat y, and voila, that's what I wanted!



Yet, I don't know if it looks all that right. I'm leaving it for now, we'll see how it works as I add graphic elements like the header graphics etc.

Ok, one more thing here, I'm adding round corners to my containers. I just really don't like how square corners look, here or in real life. When I do wood projects, I pretty much always sand down the corners and edges so they aren't perfectly square.

Following this tutorial: Rounded corners using CSS without Images.

Of course things are never that easy. I should have seen this coming. Rounded corners are a property set to borders, which means I needed to add a border, which I don't necessarily want. So fine ok I set it to white, the same color as the background, it won't show.

But then I forgot that adding a border to a container contributes to it's width, and since I already took up all the available width as I mentioned in my last post, so the sidebar fell off below the main post area. Easy enough fix, remove 1% from one of the widths. Now I just hope it doesn't break at a small screen size.

Continue Reading...

Responsive Design: Setting the Widths, and Background Color

So I was gonna do a post to say I needed to add a background color (white) to the parts with writing: post, sidebar header, then as soon as I did that I realized I needed to play with the margins and paddings, which need to be in % if I'm to do a responsive design, so what the heck I'm gonna start the responsive design thing right now with the width of the containers. Good place and time as any to start.

So yes after a couple of lines of code to make the backgrounds white to be able to read properly, I get this:



And then with some adjustments to the width and padding of the main containers (header, outer-wrapper, main and sidebar), I get this:



And it's already responsive!! I've also been coding my images inside my posts to be responsive for the long run. They are set at width 95% so they take up as much space as possible.

So here are the dets for the containers. As of right now, my outer wrapper is set to width 80%, my header width 96% with 2% paddings on each side (so total 100%), my main post area is 65% with 3% paddings on both sides and 1% margin on the right (for space between it and sidebar) (so total is 72%) and my sidebar is 21% with 3% paddings on each side and a 1% margin to the left (total 28%). Yes, I played around a lot with those #s to get what I wanted, and it might still change as I add the graphic elements and other features.

The thing to remember when you are setting these widths is that the % is based on the size of the PARENT container. outer-wrapper is inside the body (which is the entire window), header main and sidebar are inside outer-wrapper. Setting the widths of the header is easy because it takes up the entire width of the outer wrapper, but main and sidebar share the width, so their total width needs to fit inside the outer-wrapper. It's really quite easy once you get that concept down. And also remember that paddings and margins need to be counted towards the width. If it equals more than 100%, it won't look right. It won't be cut off but it won't look right.

If you're not sure what the difference between margin and padding is, check out this article from Blogger Buster. But quickly, margin is the space outside the container, and padding is the space inside the container.

You can try out the responsiveness by resizing the browser. Everything should adjust and fit as the screen gets smaller or bigger. Of course this is just the beginning for responsive design, the very base. I'll be adding media queries so that the layout changes as you get smaller, to better suit tablets and smartphones. I'm so excited for that!!
Continue Reading...

Research,Pt 2

ACtually, you know what, if I'm to do this, I'm gonna do it right (well until I get too lazy to write it all down). I'll document here, or try to, everything I read and my thoughts. Maybe this could be useful for someone else, to see the thought process that goes behind designing a blog.

First let me say I am BY NO MEANS a proffesionnal. I don't even know if I can say I'm an amateur because I've done all of 2 designs. I will count my LiveJournal "blog", that is how I learned HTML and CSS and when I started learning how to tweak both, even if only very very rudimentarily. Then I did my own blog design at Color Me Domestic, but that was a lot more graphical design and I didn't touch too much the template code except to add a couple of widgets.

So now that that is out of the way, I'll say this. If you like this stuff (I mean coding and designing) then your hard work is all that stands in the way. I'm positive I will come out of this with my own personnal made template and graphic elements. It may take a while, because I have other things I SHOULD focus on (*cough* writing my thesis *cough*), but this is more fun.

Complete side note, I did something yesterday that is making me very very happy today, even though it is SUCH a trivial thing. What is it? I cleaned my keyboard. Yes I know trivial. I popped off every key and rubbed them all with 50% ethanol (I think, why does the bottle not clearly label what type of alcohol is in there?! that's what we need to do at the lab!). And then I cleaned under the keys. There were so.many.crumbs it was DISGUSTING. Anyway, so now as I'm typing this, because I only sorta have my "doighté" (I don't know the english term??? you know when you don't need to look at your keybooard when you type?) I CAN do it, but my eyes always go back to looking at the keyboard, it's just faster. Anyway, yes I am just so happy inside that it's so clean and beautiful. I need to do my boyfriend's keyboard next. It's 10X worst than mine was.

Ok back to topic. Which was....I don't know. Where was I going with this?? Ok, documenting I suppose.

I read this series yesterday, dating back to 2007, about the basics of a template. Quick enough read, and I think it's important to understand the anatomy of a template before you start messing with it. Here: http://www.ourblogtemplates.com/2007/06/tutorials-on-blogger-template-design.html

This doesn't mean I understand everything that is written in the template, but I know the parts, which is a good start. I think it's important to really UNDERSTAND this stuff, only then can you really make something truly unique.

Next. I need to read some articles from http://www.w3schools.com/ They were referenced over and over again in the series above, and they are still up to date. I think this will really help in know what the different codes are in the template, and the different options are for changing them.

My problem right now is that I have a ton of tabs open with different articles and series about web design. I kinda have ADHD when it comes to this stuff... Which is why I am referencing here what I find that I want to read later (I suppose I could also use Pocket)

And a couple more things I want to take note of if I need it later:
1. http://styletil.es/ Love the look of this site (the doodly-ness, that's what I want in my own blog, but I've not too good at drawing or anything, so we will see how that pans out). Looks like it would be good to help you establish what you want your blog or website to look like, the layout, the color scheme and the fonts, they mention.

2. Tools for responsive design http://www.hongkiat.com/blog/rwd-tools/ 50 of them

3. Blogger Template Design series start here: http://www.bloggerbuster.com/2008/01/creating-three-column-or-wide-two.html I guess. The baellabel (holy cow that was a messed up typo, I didn't even know at first what I was trying to say1) for the serie doesn't work, and there's no table of contents type page. Still seems like it's well written and easy to understand.


~~~
Alright, so I went through the CSS tutorials on W3schools. While I learned some tricks and got some ideas as to how to do some of the things I want to do in my template, it was not specific at all to blog templates. I do think I have a better grasp of how to write CSS, the difference between id and classes, but it also brought up a lot of questions. So I'm off to find something more relevant to blog template css. I think I'll read through blogger buster now. That might be all I do tonight.

Oh and I just found this free ebook about blogger template design, I think: http://blog.themeforest.net/installation-guides/free-e-book-the-blogger-template-book/

TBC...
Continue Reading...