Let $R$ be a integral domain and $S$ a closed multiplicative subset. Then one defines
$$
S^{-1}R=\{(r,s):r\in R,s\in S\}/\sim
$$
where $(r,s)\sim(r',s')$ iff $rs'=sr'$. This set happens to be a ring with the operations
$$
(r,s)+(r',s'):=(rs'+r's,ss'),\hspace{.3cm}(r,s)(r',s'):=(rr',ss').
$$
As you can see, you get nothing but elements of $S$ in "the denominator" (the second coordinate).
If you have $R$ a ring that is not an integral domain, then the above relation $\sim$ no longer define an equivalence relation; you need to identify more elements. Now,
$$
S^{-1}R:=\{(r,s):r\in R,s\in S\}/\sim'
$$
where $(r,s)\sim'(r',s')$ iff it exists some $s''\in S:s''(rs')=s''(sr')$. The sum and product operations are defined exactly as before.
Still, as you can see, there is nothing but elements of $S$ in the denominator. The point is that the original set $S^{-1}R$ (viewed just a a set) contains just elements of the form $(r,s)$ for $r\in R$ and $s\in S$, and we are identifying some of them to obtain cosets (which we denote exactly as before but realising that $(r,s)=(rs',ss')$ for every $s\in S$) but this changes nothing cause any element you choose as the representative of your coset (element of ring) will belong to the original set $S^{-1}R$ (viewed just as a set).
Update: If the ideal $(0)$ is a prime ideal in $R$ (that is to say, if $R$ is an integral domain), then you might consider the localization at $(0)$, $S^{-1}R=:R_{(0)}$, where $S=R\setminus\{0\}$. This ring is called the field of fractions of $R$, usually denoted by $Q(R)$. Now, for every other multipicative set $S'\subset R$ you have $S'\subset S$ (given that $0\not\in S'$, but in that case $S'^{-1}R$ would be the trivial ring $\{0\}$, so let's obvious that case). Here you have a natural application $\varphi:S'^{-1}R\to S^{-1}R=Q(R)$ given by $\varphi(r,s)=(r,s)$, that is well defined because $\varphi(r,s)=\varphi(rs',ss')$ for $s'\in S'$. Actually this application is a ring homomorphism. Still, in $S^{-1}R$ you have more elements identified (cause $S$ is bigger than $S'$), and it might happen that for one element $a=\varphi(r,s)\in S^{-1}R$ there are some representative in $S^{-1}R$ that doesn't belong to $S'^{-1}R$. This is not odd. Even if we can think of $S'^{-1}R$ as a subring of $S^{-1}R$, the sets $S'^{-1}R$ and $S^{-1}R$ are different.