3 replies [Last post]
RDAxRoadkill
RDAxRoadkill's picture
Offline
newbie
Netherlands
Last seen: 4 years 11 weeks ago
Netherlands
Timezone: GMT+2
Joined: 2015-09-23
Posts: 2
Points: 3

Hello All,

Well my topic may seem a bit big and largely opinion based I was wondering 2 things.

Question A:

When I was styling a wordpress site for a client a while back I used quite a lot of margin-top etc. eventually it got to the point of having `margin-top: 85px;` and sometimes even more. Whilst this did not matter for the design as it was still responsive I wonderd if this was a good use of the property or if I should use another way.

Question B:

Kind of like the same thing as question A, however this time I was styling for specific width size's making the site responsive and all. But I think I made my code too specified or rather I was fighting my own code at a few times I think.

Example code:

@media only screen and (max-width: 320px) and (min-width: 251px) {
    div#logo img {
        width: 100%;
    }
 
    #content .site-wrapper .sidebar {
        float: left;
        width: 85%;
        padding-left: 20px;
    }
 
    body #content.withSidebar {
        width: 90%;
        float: left;
    }
}

Would this be correct or would you use another code? Ofcourse there is a `live` version (Still in development ATM)
The link is: http://grandbras.compar.nl/catering/ question A is also about this particular site.

I hope someone can help me with this. One could ofcourse say that this code would be correct since the site works and responsiveness does too but I want a more cleaner code. I have ofcourse looked through some tutorials but haven't found much to clean up my code. Any tips will be much appriated!

Thanks,
- RDAxRoadkill

//mod edit: BBCode tags added. Use [code] and [/code] tags around your html/css/js/php/etc. to maintain formatting. ~gt

RDAxRoadkill
RDAxRoadkill's picture
Offline
newbie
Netherlands
Last seen: 4 years 11 weeks ago
Netherlands
Timezone: GMT+2
Joined: 2015-09-23
Posts: 2
Points: 3

As posting this I see that my

As posting this I see that my CSS is all spaced to the left in this forum post, do note that ofcourse in the site itself I use spacing.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 40 min 52 sec ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9745
Points: 3824

Margins?

I didn't see the margins you talked about. Can you be specific where to look; both in the css and the html?

You have serious syntax errors that need fixing before debugging.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Abigale78
Abigale78's picture
Offline
newbie
Last seen: 3 years 50 weeks ago
Timezone: GMT+5
Joined: 2015-12-21
Posts: 0
Points: 1

HTML

HTML elements can have an id and/or class attribute. The id attribute assigns a name to the element it is applied to, and for valid markup, there can be only one element with that name. The class attribute assigns a class name to the element, and that name can be used on many elements within the page. CSS allows you to apply styles to particular id and/or class names. 300-206 Dumps