PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Dec 14, 2017 9:29 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Aug 07, 2017 11:06 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4377
Location: United Kingdom
Is there a way in a CSS class, to say if URL does not contain /blog, then do this.... ?

We have a full width category page which is perfect in Wordpress, but it is also assigning that class width to the Blogs. We want the Blog to not be full width.

So I wondered if it can be set to

Syntax: [ Download ] [ Hide ]
body .archive .grve-container,#disqus_thread,#grve-content.grve-left-sidebar .grve-content-wrapper,#grve-content.grve-right-sidebar .grve-content-wrapper
{
    max-width: 89%!important;
    margin-right: auto;
    margin-left: auto;
}

.... when URL does not have /blog/ in it.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Mon Aug 07, 2017 10:59 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6605
Location: WA, USA
You can't have CSS target a URL.

If your next thought is about using classes or adding some CSS just for blog pages then you're on the right track.


Top
 Profile  
 
PostPosted: Wed Oct 18, 2017 8:14 am 
Offline
Forum Newbie

Joined: Wed Oct 18, 2017 2:58 am
Posts: 3
I guess there is 2 approach to do so. 1 you can assign a specify class on blog pages by over riding the blog function.php file then write the code in style.css file. If the pages are few like 2-3 then you pick page-id and apply the css on page-id:

#page-id .anyclass > .other > .finalclass

Cheers!


Top
 Profile  
 
PostPosted: Wed Oct 18, 2017 7:02 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5978
Location: Odessa, Ukraine
Quote:
You can't have CSS target a URL.

Unless there's some JS that adds CSS classes based on the URL, like Modernizr does based on browser features.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group