/    Sign up×
Community /Pin to ProfileBookmark

Target Specific Elements

Hi Everyone, I’m new to the forum and hoping I can get some web developing help!
I’m working on a site that has a blog. That blog has a main page, that lists a group of blog posts, as well as a single post page. I’m trying to style each page differently but I realized both pages share the same data, and exactly the same html structure so I can’t target an element to style. If I style an element on one page it effects the other pages as well.
Does anyone know how to separate them?
Here is the blog page:
http://www.bellydanceamericastore.com/blog.asp

Thanks in advance!

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@rootNov 20.2018 — You find where the CSS script is inserted, alter the name of the file you want to change to a different name.

Copy the CSS file to a new file and name it the name you are going to use.

Now modify the other CSS you just made to suit your needs.

When completed, you can complete the differences and then create a common CSS style that is common to all the pages and then only need to apply the changes in a smaller CSS file as needed by the page.

Copy linkTweet thisAlerts:
@rootNov 20.2018 — [[2,3,4,8],[2,8]]
Copy linkTweet thisAlerts:
@JoNikoauthorNov 20.2018 — Are you suggesting I create a CSS file specific to the page?

I'm not sure that helps me since the HTML is the same for all the blog pages. I have access only to the main blog page and all the others are generated through a function
Copy linkTweet thisAlerts:
@PeterPan_321Nov 20.2018 — Not sure I understand... when you say you are working on the site, do you mean you are posting blogs there or actually working on the code? Because if you are working on the code, surely every blog post has some kind of identifier, even if its just the name of the text link, that makes it unique. The HTML you speak of has to be a template of some sort, right? Otherwise every blog would have the exact same content. So how in control of the code are you? The system must maintain a database of some sort with some kind of unique identifier for each blog. And all it takes is the ability to insert one small piece of PHP code in the HTML file <head> area that references another larger PHP file. From there, if that separate PHP file could just get some unique identifier (as I mentioned, even the name of the link would do), it could look up a previously stored complete block of HTML formatted CSS, unique to that particular page, and "echo" it to the page content as it loads. I'll admit it sounds like a cumbersome approach, but if you only have limited access to the HTML templates, it might be a possible approach. If you're not able to add anything to the HTMP template at all, then I think you might be out of luck.

--- but in coding, there is ALWAYS a way! :-)
Copy linkTweet thisAlerts:
@JoNikoauthorNov 21.2018 — Thank you @PeterPan_321 . I I'm working on the code and have access to the HTML. The way the blog works, is that every time the user creates a post it gets a unique link. So that link is not in the HTML. It's generated with a JS function. The blog home page is pulling data from the blog posts and just displaying them. I need a way to give the home page posts a unique identifier. Any ideas?
Copy linkTweet thisAlerts:
@rootNov 21.2018 — I am saying that you produce a CSS file that is common to all pages and on pages that have specific needs, add in the CSS for those pages when needed.

This is all down to your coding ability, ability to reduce the amount of traffic and data a user needs to get the page up, everything you can do to reduce payload is a reduction in waste and time and speeds your site delivery up for free, many people think that their is some magic code that is used to speed their sites delivery up when all it takes is for the site to be properly coded in a way that optermise's the amount of traffic per request.

Think of it like this, if you had to pay for every bit and byte, you would make sure that your site code base only had in it what was absolutely required for that page to render, today's programmers don't consider once the fact that size and speed are related.

Copy linkTweet thisAlerts:
@JoNikoauthorNov 21.2018 — Ok, I have a CSS that is common to all pages, but my question is how do I create CSS for a specific page when I don't have access to that page?
×

Success!

Help @JoNiko spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.10,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...